5 Replies Latest reply on Jul 13, 2017 5:00 PM by Zhouyi Zhang

# Calculate Median for the same 30-Day Period Each Year

Hi everyone,

Is there a way to create a filter or calculated field to calculate and compare (% difference) of medians for the same period of time over years?

For example, let's say I wanted to calculate the median of sales made in November 1-7, 2016, but is there a way to also compare that median to the median of sales made in Nov 1-7 in 2015, 2014, and 2013? I don't have any dummy data available to me for a similar scenario (so sorry!), but please feel free to upload anything or ask for further clarification!

Thank you!

• ###### 1. Re: Calculate Median for the same 30-Day Period Each Year

Hi, Natalie

Below is the screenshot of the result and the calculation field I created.

Hope this could help, please let me know if you have question.

ZZ

• ###### 2. Re: Calculate Median for the same 30-Day Period Each Year

Hi Zhouyi,

Thank you for this. Unfortunately I'm unable to open the file.. do you mind uploading in .twb? It may be because I am using Tableau 10.1

Also, do you think it would make a difference if it was median # of Sales? For example, If the median # of Sales for 11/1-11/7/16 was 33 sales for the day as opposed to the dollar value?

Again, thank you for the quick response!

• ###### 3. Re: Calculate Median for the same 30-Day Period Each Year

Hi, Natalie

If you want median of # of sales, Please see my updated solution below

The workbook I attached is version 10.2. If you can't open it, please follow the screenshot above which should include every calculations I used in the sample.

Please let me know if you still have problem with that

ZZ

• ###### 4. Re: Calculate Median for the same 30-Day Period Each Year

The above is great, but I am not using extracted data. Any suggestions for a dynamic data source?

Thanks

• ###### 5. Re: Calculate Median for the same 30-Day Period Each Year

Hi, Natalie

can you tell me what do you mean dynamic data source?

ZZ