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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
hobosapien
Helper I
Helper I

Using RANKX to create a ranking based on a count of occurence in a column

I have a fairly large table with many columns. One of these columns is a list of musical artists, of which their name can appear many times (hundreds in fact). I am attempting to rank the artist based on this count but the RANKX function I've come up with is ranking everything at a "1". Some of the counts may be tied and so a dense rank would be preferable I think.

 

 Function I used:

 

Rank Artist = RANKX(ALLSELECTED(SpotifyExtended[artist_name]),COUNT(SpotifyExtended[artist_name]))

 

Example table:

artist_name
Bonobo
Bonobo
Bonobo
Bonobo
Bonobo
Bonobo
Emancipator
Emancipator
Emancipator
Emancipator
Emancipator
Bluetech
Bluetech
Bluetech
Bluetech
Gramatik
Gramatik
Gramatik
Shlohmo
Shlohmo
Porn Sword Tobacco

 

This is what I'd like the end result to look like:

 

ArtistCountRank
Bonobo61
Emancipator52
Bluetech43
Gramatik34
Shlohmo25
Porn Sword Tobacco16
1 ACCEPTED SOLUTION
PhilipTreacy
Super User
Super User

Hi @hobosapien 

 

You need 2 measures

 

Count = COUNTROWS('DataTable')

 

Rank = RANKX(ALL('DataTable'[artist_name]), [Count])

 

PhilipTreacy_0-1727306737288.png

 

Regards

 

Phil

 



Did I answer your question? Then please mark my post as the solution.
If I helped you, click on the Thumbs Up to give Kudos.


Blog :: YouTube Channel :: Connect on Linkedin


Proud to be a Super User!


View solution in original post

2 REPLIES 2
PhilipTreacy
Super User
Super User

Hi @hobosapien 

 

You need 2 measures

 

Count = COUNTROWS('DataTable')

 

Rank = RANKX(ALL('DataTable'[artist_name]), [Count])

 

PhilipTreacy_0-1727306737288.png

 

Regards

 

Phil

 



Did I answer your question? Then please mark my post as the solution.
If I helped you, click on the Thumbs Up to give Kudos.


Blog :: YouTube Channel :: Connect on Linkedin


Proud to be a Super User!


Doesn't seem to work on my table for some reason, it still lists a vast majority of them at a 1.

 

HOWEVER, I rebuilt the table using just the list of artists (no other columns) and it worked. 

Helpful resources

Announcements
Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

Check out the October 2025 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors