cancel
Showing results for
Did you mean:

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Frequent Visitor

## 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

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

1 ACCEPTED SOLUTION
Super User

Hi @Nick_Kalichava ,
If you want to rank based on multiple column you follow this blog .
https://www.sqlbi.com/articles/rankx-on-multiple-columns-with-dax-and-power-bi/
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.

Proud to be a Super User!

3 REPLIES 3
Super User

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.

Proud to be a Super User!

Frequent Visitor

my task is to rank by 2 different ranks in one column.

Super User

Hi @Nick_Kalichava ,
If you want to rank based on multiple column you follow this blog .
https://www.sqlbi.com/articles/rankx-on-multiple-columns-with-dax-and-power-bi/
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.

Proud to be a Super User!

Announcements

#### Fabric certifications survey

Certification feedback opportunity for the community.

#### Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

#### Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.

Top Solution Authors
Top Kudoed Authors