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

Power BI is turning 10! Let’s celebrate together with dataviz contests, interactive sessions, and giveaways. Register now.

Reply
tvalente
Helper I
Helper I

Median Calculation Help - Need to not have key in my table

Median calculation help - I get the right value if the dimension is in the table
3m ago

Hi All,

 

I want to return the median of some values. But in this instance, I don't want my dimension to appear in my table. This is because I want to create a scatter plot later on.

 

My Median calculation:

 

Median = 
CALCULATE(
MEDIAN(Reward),
ALLEXCEPT('Data', 'Data'[Key2])

)

Key2 is a calculated column:

 

Key2 = CONCATENATE([Career Level],[Location])
 
If my data looks like this with key2 present (I get the answer I want)
 
Employee NameKey2RewardMedian
AgathaW4BAH42,00033,000
TimothyW4BAH24,00033,000
BobW4RAK220,000222,500
GregW4RAK225,000

222,500

 

What I want to do is have this:

 
Employee NameRewardMedian
Agatha42,00033,000
Timothy24,00033,000
Bob220,000222,500
Greg225,000

222,500

 


But if I remove KEY2 and replace with Career (Career is what I want in my scatter plot legend). My answer becomes this, which is wrong:

 

Employee NameCareerRewardMedian
AgathaW442,000200,000
TimothyW424,000200,000
BobW4220,000200,000
GregW4225,000

200,000

 

Any ideas?

 

Thanks all

 

Tiago

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @tvalente ,

Please try this measure.

Median = CALCULATE(MEDIAN('Data'[Reward]),ALL('Data'[Employee Name]),VALUES('Data'[Key2]))

vcgaomsft_0-1683869034079.png

 

Best Regards,
Gao

Community Support Team

 

If there is any post helps, then please consider Accept it as the solution  to help the other members find it more quickly. If I misunderstand your needs or you still have problems on it, please feel free to let us know. Thanks a lot!

How to get your questions answered quickly --  How to provide sample data in the Power BI Forum

View solution in original post

2 REPLIES 2
tvalente
Helper I
Helper I

Thank you 🙂

 

That worked a treat

Anonymous
Not applicable

Hi @tvalente ,

Please try this measure.

Median = CALCULATE(MEDIAN('Data'[Reward]),ALL('Data'[Employee Name]),VALUES('Data'[Key2]))

vcgaomsft_0-1683869034079.png

 

Best Regards,
Gao

Community Support Team

 

If there is any post helps, then please consider Accept it as the solution  to help the other members find it more quickly. If I misunderstand your needs or you still have problems on it, please feel free to let us know. Thanks a lot!

How to get your questions answered quickly --  How to provide sample data in the Power BI Forum

Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

Check out the June 2025 Power BI update to learn about new features.

June 2025 community update carousel

Fabric Community Update - June 2025

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