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
AndreiK15
Helper II
Helper II

Get Median Value on each row

Hi,

 

I have the following problem:

 

I need to get median value for Sales Margin Amt so I'm using this formula:

 

v2 Median Margin = MEDIANX(VALUES(fact_sales[Article Id]),[Total Margin Amt])
 
AndreiK15_0-1630955989440.png

I need a formula to return on each row the same value as total (1535.54).

 

I use few calculate measures to do so, but still not working.

 

Sum of Median = CALCULATE([v2 Median Margin], FILTER(ALLSELECTED(fact_sales),fact_sales[Article Id]=MAX(fact_sales[Article Id])))
 
AndreiK15_1-1630956105870.png


Can someone help me with this?

 

Values from Sales Margin Amt and Sales Net Amt are SUM of each Article Code

 

AndreiK15_2-1630956207365.pngAndreiK15_3-1630956222669.png

 

 
Thank you!
1 ACCEPTED SOLUTION
AndreiK15
Helper II
Helper II

Figure it out! So if someone need it, bellow you can find the solution:

 

v4 Median Margin = IF([Total Sales]=BLANK(),BLANK(),MEDIANX(
SUMMARIZE(ALLSELECTED('fact_sales'),fact_sales[Article Id],"MedianValue",[Total Margin Amt]),[MedianValue]))

View solution in original post

1 REPLY 1
AndreiK15
Helper II
Helper II

Figure it out! So if someone need it, bellow you can find the solution:

 

v4 Median Margin = IF([Total Sales]=BLANK(),BLANK(),MEDIANX(
SUMMARIZE(ALLSELECTED('fact_sales'),fact_sales[Article Id],"MedianValue",[Total Margin Amt]),[MedianValue]))

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.