Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
5 years ago
Solved

Rankx Vs Sort By Column

Hello all, I have a dataset like that: Market Product Color Date Sales Market A Red January 20  $    9,880 Market B Blue February 20  $    9,418 Market C Yellow March 20  $ ...
  • mahoneypat's avatar
    5 years ago

    If you are using the Market column from your sort table and you have sorted that column by the Order column, you'll need an expression like this.  Replace MarketSort with the actual name of that table.

     

    MarketRank =
    RANKX (
        ALLSELECTED ( MarketSort[Market], MarketSort[Order] ),
        CALCULATE ( SUM ( Markets[Sales] ) ),
        ,
        DESC
    )

    Pat