Forum Discussion
Anonymous
7 years agoNot applicable
Ranking multiple columns
Hi Power BI community. I am relatively new to Power BI so bear with me. I have a table of data where each row represents a production run on a specific by a specific team on a specific model etc...
- 7 years ago
Hello Anonymous
The only way I know of to do what you are looking for is to unpivot the defects informatoin so you end up with 2 columns, defect type and value. Then you can do the ranking on the value column.
Top 3 defects = VAR RankingContext = VALUES ( Defects[Defect] ) RETURN CALCULATE( [Defect Amount], TOPN ( 3, ALL ( Defects[Defect] ), [Defect Amount] ), RankingContext )I have attached my sample file for you to look at.
jdbuchanan71
Super User
7 years agoHello Anonymous
The only way I know of to do what you are looking for is to unpivot the defects informatoin so you end up with 2 columns, defect type and value. Then you can do the ranking on the value column.
Top 3 defects =
VAR RankingContext = VALUES ( Defects[Defect] )
RETURN
CALCULATE(
[Defect Amount],
TOPN ( 3, ALL ( Defects[Defect] ), [Defect Amount] ),
RankingContext
)
I have attached my sample file for you to look at.