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

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

Reply
TcT85
Helper III
Helper III

DAX - Get the highest Median value from multiple columns.

Could anyone please help me create the dax formula.

 

Is there a way to get the highest median value from multiple products for a product/date?

 

ProductSerialnumberDateTimeMachine 1Machine 2Machine 3Machine 4Machine 5Machine 6
A111112024-05-0309:20:0116227577
A111122024-05-0310:20:0115210688
A111132024-05-0311:20:0116116577
A111142024-05-0312:20:0115218688
A111152024-05-0313:20:0116110577
A111162024-05-0314:20:0114211688
A111172024-05-0315:20:0117112577
A111182024-05-0316:20:0115211688
A111192024-05-0317:20:0116112577
A111202024-05-0318:20:0115213688
A111212024-05-0319:20:0113135577
A111222024-05-0320:20:0115225688
A111232024-05-0321:20:0116114577
          
          
          
   Median15213577
          
   Highest Median15     

 

I'm in need of 2 following visualisation:

1. Highest median per product.

2. Highest median per product over a time period like weeks.

1 ACCEPTED SOLUTION

Alright, if you prefer not to unpivot the columns (which might not be the best approach anyway), you can proceed as follows:

1)Create a measure for each machine that calculates the median, like this:

 

machine1Median = MEDIAN('Table (3)'[Machine 1])
machine2Median = MEDIAN('Table (3)'[Machine 2])

 

...and so on, for each machine you have.

 

2)Then, to find the maximum of the medians, you can use the following formula:

 

maxmedian = MAXX(
UNION(
SUMMARIZE('Table (3)', 'Table (3)'[Product], "Median", [machine1Median]),
SUMMARIZE('Table (3)', 'Table (3)'[Product], "Median", [machine2Median])

 

(...and so on, for each machine you have)


),
[Median]
)

 

3)Lastly, you can display the products and their corresponding maximum median in a table visual


 

View solution in original post

6 REPLIES 6
TcT85
Helper III
Helper III

Gabry, thank you for your support, it works as intended.

Gabry
Super User
Super User

Hello,

isn't as easy as:

 

MedianProduct = Maxx(Productstable, yourmedianformula)

HI Gabry,

 

How would you write the median formula? 😅

It depends on how is set up your model. Why do you have machines in the columns, is your data set that way?

If so you should unpivot those columns before calculate the median. 

If that was just the visualization but the data it's not in that format the formula should look like this

MedianFormula = calculate(median(table[values]), all(products))

 

This formula calculates the median of the values in the "values" column, disregarding any filters applied to the "products" table.

Hi Gabry,

 

The data is set that way.

The product goes through 5 machines and we get the machine time for each machine.

We need to find the highest median time to be able to create a tact time..

Alright, if you prefer not to unpivot the columns (which might not be the best approach anyway), you can proceed as follows:

1)Create a measure for each machine that calculates the median, like this:

 

machine1Median = MEDIAN('Table (3)'[Machine 1])
machine2Median = MEDIAN('Table (3)'[Machine 2])

 

...and so on, for each machine you have.

 

2)Then, to find the maximum of the medians, you can use the following formula:

 

maxmedian = MAXX(
UNION(
SUMMARIZE('Table (3)', 'Table (3)'[Product], "Median", [machine1Median]),
SUMMARIZE('Table (3)', 'Table (3)'[Product], "Median", [machine2Median])

 

(...and so on, for each machine you have)


),
[Median]
)

 

3)Lastly, you can display the products and their corresponding maximum median in a table visual


 

Helpful resources

Announcements
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

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

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.