Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
7 years ago
Solved

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...
  • jdbuchanan71's avatar
    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.