Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
Anonymous
Not applicable

MEDIANX and SUMMARIZE - need to exclude 0

Hello All!

 

Median =

MEDIANX(SUMMARIZE(GData,GData[Account],
                            "Contacts",CALCULATE(SUM(GData[TotalContacts]),FILTER(GData,GData[TotalContacts] <>  0  )),"FTE", CALCULATE(AVERAGE(GData[L1FTECount]),FILTER(GData,GData[L1FTECount] <> 0 ))),DIVIDE([Contacts],[FTE]))

It seems that it is still including zeros in the median which is why I am still getting the wrong median number. I hope someone can help with how to eliminate 0 in this measure.

Thanks!
1 ACCEPTED SOLUTION
amitchandak
Super User
Super User

@Anonymous , Try like

MEDIANX(filter(SUMMARIZE(GData,GData[Account],
"Contacts",SUM(GData[TotalContacts])
,"FTE", AVERAGE(GData[L1FTECount])),[Contacts] <> 0 && [FTE]<>0)
,DIVIDE([Contacts],[FTE]))

View solution in original post

2 REPLIES 2
Anonymous
Not applicable

This works like a charm. Thank you!

amitchandak
Super User
Super User

@Anonymous , Try like

MEDIANX(filter(SUMMARIZE(GData,GData[Account],
"Contacts",SUM(GData[TotalContacts])
,"FTE", AVERAGE(GData[L1FTECount])),[Contacts] <> 0 && [FTE]<>0)
,DIVIDE([Contacts],[FTE]))

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.