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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
Anonymous
Not applicable

Median function on a MAX column

Hello,

 

I am trying to calculate the median on a max column (Max_DelaiH). I had to create a max column because I have duplicates. 

Loladba_0-1646842035937.png

I tried 

Tmps_Median = VAR __table4 = SUMMARIZE('Documents',[No-QR7],"__value4",[MAX_DelaiH])
RETURN
IF(HASONEVALUE(Documents[No-QR7]),[MAX_DelaiH],MEDIAN(__table4,[__value4]))
 
But I can't do the MEDIAN function on a line.
Can anybody help me? Is there a median function for a line?

 

1 ACCEPTED SOLUTION
v-chenwuz-msft
Community Support
Community Support

Hi @Anonymous ,

 

Please add function CALCULATE() out side the MEDIAN function or MEDIANX(). Like the following expression.

 

Tmps_Median = 
VAR __table4 = SUMMARIZE('Documents',[No-QR7],"__value4",[MAX_DelaiH])
RETURN
IF(HASONEVALUE(Documents[No-QR7]),[MAX_DelaiH],
CALCULATE(MEDIAN([__value4]), '__table4')
)
 
OR
 
Tmps_Median = 
VAR __table4 = SUMMARIZE('Documents',[No-QR7],"__value4",[MAX_DelaiH])
RETURN
IF(HASONEVALUE(Documents[No-QR7]),[MAX_DelaiH],
MEDIANX(__table4,[__value4])
)
 

Best Regards

Community Support Team _ chenwu zhu

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

 

View solution in original post

2 REPLIES 2
v-chenwuz-msft
Community Support
Community Support

Hi @Anonymous ,

 

Please add function CALCULATE() out side the MEDIAN function or MEDIANX(). Like the following expression.

 

Tmps_Median = 
VAR __table4 = SUMMARIZE('Documents',[No-QR7],"__value4",[MAX_DelaiH])
RETURN
IF(HASONEVALUE(Documents[No-QR7]),[MAX_DelaiH],
CALCULATE(MEDIAN([__value4]), '__table4')
)
 
OR
 
Tmps_Median = 
VAR __table4 = SUMMARIZE('Documents',[No-QR7],"__value4",[MAX_DelaiH])
RETURN
IF(HASONEVALUE(Documents[No-QR7]),[MAX_DelaiH],
MEDIANX(__table4,[__value4])
)
 

Best Regards

Community Support Team _ chenwu zhu

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

 
Anonymous
Not applicable

Thank you, I will try it but I realised I didn't need to do it in the end.

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.