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

Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started

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
July 2024 Power BI Update

Power BI Monthly Update - July 2024

Check out the July 2024 Power BI update to learn about new features.

PBI_Carousel_NL_June

Fabric Community Update - June 2024

Get the latest Fabric updates from Build 2024, key Skills Challenge voucher deadlines, top blogs, forum posts, and product ideas.

Top Solution Authors