Forum Discussion

epmck11's avatar
epmck11
Frequent Visitor
8 years ago
Solved

Ranking sums based on condition

Hi all,   I'm still learning DAX, and it's a bit of an adjustment for me, so any help would be appreciated. I'm trying to rank the sums of values based on criteria. Imagine I have a table like this...
  • Vvelarde's avatar
    8 years ago

    epmck11

     

    Hi, try with this measure

     

    RankbyBranch-Customer =
    IF (
        HASONEVALUE ( Table1[Customer] );
        RANKX (
            ALLSELECTED ( Table1[Customer] );
            CALCULATE ( SUM ( Table1[Revenue] ) )
        )
    )

     

    Regards

     

    Victor