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

Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!

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
April AMA free

Microsoft Fabric AMA Livestream

Join us Tuesday, April 09, 9:00 – 10:00 AM PST for a live, expert-led Q&A session on all things Microsoft Fabric!

March Fabric Community Update

Fabric Community Update - March 2024

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