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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
sshokri89
Helper I
Helper I

RANKING based on two columns - Group & Subgroup

Hi all,

 

I need to create a ranking in a specific manner; below is a sample data:

 

sshokri89_1-1641882751616.png

 

 

I have created GROUP as a calculated column using below measure:

Group = "Dealer " & RANKX(ALL(TABLE),TABLE[National Group],,ASC,Dense)

now I need to create another Calculated column but that needs to follow GROUP. In other words, I need to RANK each row based on their TOTAL value. for example, first row > total: 1 is the lowest amongst 4 rows. So I want to rank it as 1.4. Then second row is highest of all for DEALER 1 so it's my 1.1. The same logic is applied for all.
 
Thanks all for your help in advance 🙂
1 ACCEPTED SOLUTION
ALLUREAN
Solution Sage
Solution Sage

Hi, @sshokri89 

 

Please check this example:

 

https://www.dropbox.com/s/udyww9onx3sjvj2/RANKING%20based%20on%20two%20columns%28allure-analytics.co...

 

Group_Calculated = "Dealer " & RANKX(ALL('TABLE'),'TABLE'[National Group],,ASC,Dense)
 
SubGroup =
"Dealer " &
RANKX(FILTER('TABLE',
'TABLE'[National Group] = EARLIER('TABLE'[National Group])),
'TABLE'[Total],,DESC)

Did I answer your question? Please Like and Mark my post as a solution if it solves your issue. Thanks.

Appreciate your Kudos !!!

https://allure-analytics.com/

https://www.youtube.com/channel/UCndD_QZVNB_JWYLEmP6KrpA

https://www.linkedin.com/company/77757292/

 

 




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


https://allure-analytics.com/
https://www.youtube.com/channel/UCndD_QZVNB_JWYLEmP6KrpA
https://www.linkedin.com/company/77757292/

Proud to be a Super User!




View solution in original post

2 REPLIES 2
ALLUREAN
Solution Sage
Solution Sage

Hi, @sshokri89 

 

Please check this example:

 

https://www.dropbox.com/s/udyww9onx3sjvj2/RANKING%20based%20on%20two%20columns%28allure-analytics.co...

 

Group_Calculated = "Dealer " & RANKX(ALL('TABLE'),'TABLE'[National Group],,ASC,Dense)
 
SubGroup =
"Dealer " &
RANKX(FILTER('TABLE',
'TABLE'[National Group] = EARLIER('TABLE'[National Group])),
'TABLE'[Total],,DESC)

Did I answer your question? Please Like and Mark my post as a solution if it solves your issue. Thanks.

Appreciate your Kudos !!!

https://allure-analytics.com/

https://www.youtube.com/channel/UCndD_QZVNB_JWYLEmP6KrpA

https://www.linkedin.com/company/77757292/

 

 




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


https://allure-analytics.com/
https://www.youtube.com/channel/UCndD_QZVNB_JWYLEmP6KrpA
https://www.linkedin.com/company/77757292/

Proud to be a Super User!




amitchandak
Super User
Super User

@sshokri89 

Assume total is column , a new column

 

Group = "Dealer " & RANKX(filter(TABLE,TABLE[National Group] = earlier(TABLE[National Group]) ), [Total],,ASC,Dense)

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

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

April Fabric Community Update

Fabric Community Update - April 2024

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