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

Don't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.

Reply
ace_SB
Frequent Visitor

Median PowerBI vs Excel

Hi All,

 

I am using Median function for some fields. For two fields, the median value in excel is different than what I get in PowerBI. The one is excel is what I want. Seems like excel is ignoring null values while PowerBI is not. Do I need to change the way I use Median function in PowerBI to get the results that I get in excel?

 

Thanks

 

MedianIssue.JPG

1 ACCEPTED SOLUTION
ace_SB
Frequent Visitor

I think I got it:

 

MedScore = ROUND(
CALCULATE(
   medianx(FILTER(vw_ABC, vw_ABC[Score1]<> BLANK()),

              vw_ABC[Score1]) ,

           TREATAS(VALUES('vw_Option'[StuName]),vw_ABC[IStuName])
),0
)

View solution in original post

4 REPLIES 4
v-piga-msft
Resident Rockstar
Resident Rockstar

Hi @ace_SB

 

You could have a reference of this similar thread.

 

Best Regards,

Cherry

Community Support Team _ Cherry Gao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Thanks Cherry.

 

How can we ignore NULL values in the median function?

 

This is the formula I am using right now:

MedScore = ROUND(CALCULATE(medianx(vw_ABC,(vw_ABC[Score1])),
TREATAS(VALUES('vw_Option'[StuName]),vw_ABC[StuName])),0)

ace_SB
Frequent Visitor

I think I got it:

 

MedScore = ROUND(
CALCULATE(
   medianx(FILTER(vw_ABC, vw_ABC[Score1]<> BLANK()),

              vw_ABC[Score1]) ,

           TREATAS(VALUES('vw_Option'[StuName]),vw_ABC[IStuName])
),0
)

ace_SB
Frequent Visitor

Any suggestion?

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

ArunFabCon

Microsoft Fabric Community Conference 2025

Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.