Median Function Formula-Data Modeling (DAX)

jvega

New Member
Joined
Dec 25, 2017
Messages
1
Hello! Merry Christmas to all!

I have a report to submit on Wednesday. I have tried all weekend long to solve this with no luck, thus I'm here hoping someone with more experience has any hints.

The report requires the calculation of the median as one of the measures for a Salary/Wages column given the individual was employed in a specified quarter. The people who were employed are being calculated in Q2Num formula(a count based on dates and employment). I've also tried to add the criteria directly in a FILTER function to the formula below but still, I receive a different Median result if I manually take the salaries in a separate Excel tab and use the Median formula on it. Why is the Median function not calculating correctly in the formula area for my pivot table?

This is the current formula I'm using in the Data Modeling for my pivot table:
Code:
Median:=CALCULATE(MEDIAN(Table1[Salary]),FILTER(Table1,Table1[Salary]>0 && Table1[Q2Num]))

Note that the Salary column does have some records that have a null salary or 0 salary. These should be ignored in the median calculation and it's the reason I used the filter function above. Why am I getting different results with the Median function for my pivot table? Am I missing something to get the correct set of Salary records for the median?

Any insight is helpful. I also want to learn from this for the future.

Thank you.
 

Excel Facts

What is =ROMAN(40) in Excel?
The Roman numeral for 40 is XL. Bill "MrExcel" Jelen's 40th book was called MrExcel XL.

Forum statistics

Threads
1,224,820
Messages
6,181,159
Members
453,021
Latest member
Justyna P

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top