cancel
Showing results 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

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])

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])))

Can someone help me with this?

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

Thank you!
1 ACCEPTED SOLUTION
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]))
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]))