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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request 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
November Power BI Update Carousel

Power BI Monthly Update - November 2025

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

Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

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.

Top Solution Authors
Top Kudoed Authors