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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
tvalente
Helper I
Helper I

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

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
v-shex-msft
Community Support
Community Support

HI @tvalente,

Did you mean to show the aggerated result values on chart without add correspond category fields? If that is the case, I'd like to suggest you use SUMMARIZE function to summary table records based on correspond category group in variable and use iterator function to aggerate calculated results.

Measure Totals, The Final Word 
Regards,

Xiaoxin Sheng

Community Support Team _ Xiaoxin
If this post helps, please consider accept as solution to help other members find it more quickly.

View solution in original post

1 REPLY 1
v-shex-msft
Community Support
Community Support

HI @tvalente,

Did you mean to show the aggerated result values on chart without add correspond category fields? If that is the case, I'd like to suggest you use SUMMARIZE function to summary table records based on correspond category group in variable and use iterator function to aggerate calculated results.

Measure Totals, The Final Word 
Regards,

Xiaoxin Sheng

Community Support Team _ Xiaoxin
If this post helps, please consider accept as solution to help other members find it more quickly.

Helpful resources

Announcements
LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.

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.