Forum Discussion

FaisalKarawalla's avatar
FaisalKarawalla
Frequent Visitor
4 years ago
Solved

Ranking Based on Two Columns

Hello,   Am trying to come up with a logic that will help me in creating a ranking.   So the rank depends on two variable percentages (Columns). Lets Say Percentage 1 and Percentage 2.   The de...
  • Anonymous's avatar
    Anonymous
    4 years ago

    Hi FaisalKarawalla ,

    Please try below steps:
    1.Create an auxiliary column

    HP_Column =
    VAR rank_by_kpi =
        RANKX ( 'Table', 'Table'[KPI Percentage],, DESC )
    VAR rank_by_death =
        RANKX ( 'Table', 'Table'[Death Percentage],, ASC )
    VAR ct_rows =
        COUNTROWS ( 'Table' ) + 1
    RETURN
        rank_by_death + DIVIDE ( rank_by_kpi, ct_rows )
    

     

    2.Rank by the new auxiliary column

    Rank_Num =
    RANKX ( 'Table', 'Table'[HP_Column],, ASC )
    

     

    Best regards,
    Community Support Team_ Binbin Yu
    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.