Forum Discussion
DAX - Get the highest Median value from multiple columns.
- 2 years ago
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
Gabry, thank you for your support, it works as intended.