
As you can see below, the pivot table is correctly calculating the medians. In the Define Measure dialog, fill out the four entries shown below:Īfter creating the measure, it is added to the list of fields, but you have to choose the entry to add it to the Values area of the pivot table. Measures are more powerful than calculated fields in regular pivot tables. "Measure" is a fancy name for a calculated field. Instead, right-click on the Table heading and choose New Measure. In the Pivot Table Fields, choose Region and District. In the Insert PivotTable dialog, choose the box for Add This Data to the Data Model. To begin, select one cell in your data and press Ctrl + T to format the data as a table. Excel averages those two values to return 12000. That means the median is somewhere between 1100. But for the whole data set, there are 12 values.


In the case of Chicago, there are five values, so the Median will be the 3rd highest value. You can see the median for Chicago should be 5000 and the median for Cleveland should be 17000. Here is my very simple data set that I will use to test how pivot table medians are calculated.

What does it take to use DAX in a pivot table? You need the Windows version of Excel running Excel 2013 or newer. A quick Google search and Yes! There is a DAX function for Median. So when Alex in my Houston Power Excel seminar asked about creating medians, I was quick to say "No". I remember back in 2000 when I hired Excel MVP Juan Pablo Gonzalez to write an awesome macro that created reports that looked like pivot tables but had Medians. This question comes up once every decade: Can you do a Median in a pivot table.
