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

Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!

Reply
suren947
Helper I
Helper I

Help to calcualte RankX on two columns

Hi All,

I have below data and want to calcualte Rank

Root CategoryCategoryID
ACat3
 Lion1
 Pig4
 Rat2
 Tiger5
BCat6
 Lion9
 Pig3
 Rat4
 Tiger1

 

Want to create Rank column based on Root Category and Category Column as below

Root CategoryCategoryIDRank
ACat33
 Lion15
 Pig42
 Rat24
 Tiger51
BCat62
 Lion91
 Pig34
 Rat43
 Tiger15

 

1 ACCEPTED SOLUTION
v-jayw-msft
Community Support
Community Support

Hi @suren947 ,

 

Check the formula.

Column = RANKX(FILTER('Table','Table'[Root Category]=EARLIER('Table'[Root Category])),'Table'[ID],,DESC)

1.PNG

If you want add other groups, just add [column] = earlier([column]) to the filter part of the formula.

 

Best Regards,

Jay

Community Support Team _ Jay
If this post helps, then please consider Accept it as the solution
to help the other members find it.

View solution in original post

3 REPLIES 3
v-jayw-msft
Community Support
Community Support

Hi @suren947 ,

 

Check the formula.

Column = RANKX(FILTER('Table','Table'[Root Category]=EARLIER('Table'[Root Category])),'Table'[ID],,DESC)

1.PNG

If you want add other groups, just add [column] = earlier([column]) to the filter part of the formula.

 

Best Regards,

Jay

Community Support Team _ Jay
If this post helps, then please consider Accept it as the solution
to help the other members find it.
amitchandak
Super User
Super User

@suren947 , Try a new column

 

rankx(filter(Table,[Root Category] = earlier([Root Category])),[ID],,desc, dense)

Thank you but expression not working

Helpful resources

Announcements
April AMA free

Microsoft Fabric AMA Livestream

Join us Tuesday, April 09, 9:00 – 10:00 AM PST for a live, expert-led Q&A session on all things Microsoft Fabric!

March Fabric Community Update

Fabric Community Update - March 2024

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