Forum Discussion

Nick_Kalichava's avatar
Nick_Kalichava
Frequent Visitor
3 years ago
Solved

double RANKX ? HOW?

Hello, experts!

I need help with RANKX

In my table I rank groups by Quantity sold and by Amount sold. (So i have 2 rankings)

,

measure 1 -
Rank_by_quantity =
RANKX(
ALL(Table[GROUP]),
CALCULATE(COUNTA(Table[Quanity]))
)
measure 2 - 
Rank_by_amount =
RANKX(
ALL(Table[GROUP]),
CALCULATE(SUM(Table[AMOUNT]))
)


BUT

as you can see in the picture below there are 4 groups ranked 4 in quantity

The task is,

First I rank groups by quantity sold, but if the ranking is the same it should rank my an amount.

3 Replies

  • Hi Nick_Kalichava ,
    Try to use Dense in the Rankx function.
    For example :-

    Rank_by_quantity =
    RANKX(
    ALL(Table[GROUP]),
    CALCULATE(COUNTA(Table[Quanity])) ,DESC,dense)
    Thanks,
    Pratyasha Samal
    Has this post solved your problem? Please Accept as Solution so that others can find it quickly and to let the community know your problem has been solved.
    If you found this post helpful, please give Kudos C