Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Don't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.

Reply
Nick_Kalichava
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)

,Nick_Kalichava_0-1688563131780.png

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

Nick_Kalichava_1-1688563523998.png

The task is,

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

1 ACCEPTED SOLUTION

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/
Hope this was helpful.
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





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!





View solution in original post

3 REPLIES 3
pratyashasamal
Memorable Member
Memorable Member

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

 





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!





Please,

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

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/
Hope this was helpful.
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





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!





Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Prices go up Feb. 11th.

Jan25PBI_Carousel

Power BI Monthly Update - January 2025

Check out the January 2025 Power BI update to learn about new features in Reporting, Modeling, and Data Connectivity.

Jan NL Carousel

Fabric Community Update - January 2025

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