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

Compete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.

Reply
randyvdr
Frequent Visitor

Ranking a list of values

Hello Power bi Community

 

Could you please help me with the following challenge:

 

I have the following  data:

NamesValues
Bird, Dog, Cat4
Cat, Fish, Bird2
Dog, Elephant, Lion3
Lion, Bird, Cat1

 

And I want to rank each one of the names by sum of values, the result should be something like this:

 

NamesValues
Dog 7
Cat7
Bird6
Fish2
Elephant3
Lion1
Mouse1
1 ACCEPTED SOLUTION
Bmejia
Super User
Super User

The first thing you want to do is transform your data you can not rank it in the format you have it with commas without getting to very complex calculations to extract the data.

Transform the data:

Bmejia_0-1692307540751.png

 

Split Data

Bmejia_1-1692307578818.png

Unpivot the data (Remove any spaces)

Bmejia_2-1692307619625.png

Group By

Bmejia_3-1692307723603.png

 

Apply the changes then create a measure like the sample below to give you the rank

Rankx = RANKX(ALL(RankAnimals[Animals]),CALCULATE(SUM(RankAnimals[Values])),,ASC,Dense)

Bmejia_4-1692307907300.png

 





View solution in original post

1 REPLY 1
Bmejia
Super User
Super User

The first thing you want to do is transform your data you can not rank it in the format you have it with commas without getting to very complex calculations to extract the data.

Transform the data:

Bmejia_0-1692307540751.png

 

Split Data

Bmejia_1-1692307578818.png

Unpivot the data (Remove any spaces)

Bmejia_2-1692307619625.png

Group By

Bmejia_3-1692307723603.png

 

Apply the changes then create a measure like the sample below to give you the rank

Rankx = RANKX(ALL(RankAnimals[Animals]),CALCULATE(SUM(RankAnimals[Values])),,ASC,Dense)

Bmejia_4-1692307907300.png

 





Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

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

August 2025 community update carousel

Fabric Community Update - August 2025

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

Top Solution Authors