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
Anonymous
Not applicable

Ranking across multiple columns

Hi! I'm new to Power BI.

 

I have survey findings of sentiments (1 - 5) for 10 categories. There are 1000 respondents with additional data such as location, age and gender. I end up with 10 columns of ratings with 1000 rows.

 

First, how do I find the Top 3/ Bottom 3 rated category across the 10 columns? Each category rating is calculated by average.

 

Second, can I add slicers to the data set and have it change accordingly to location/age/gender?

 

Sample data here

2 ACCEPTED SOLUTIONS
Jihwan_Kim
Super User
Super User

Hi, @Anonymous 

If it is OK with you, please share the sample pbix file or sample data.

It will be very much helpful if I can see the sample to come up with a desirable outcome with possible solutions.

 

Thank you very much.

 

If this post helps, then please consider accepting it as the solution to help other members find it faster, and give a big thumbs up.


Go to My LinkedIn Page


View solution in original post

Hi, @Anonymous  

Thank you very much for sharing.

I hope I come up with what you needed.

 

I unpivoted your original table to look like the below in order to calculate numbers per each category.

Then I wrote two measures like below.
You can also check some other measures in the PBIX file that I have connected to the link below.

 

Avg. Rating Ranking Desc =
RANKX( ALL(Data[Category]), [Avg. Rating],,DESC)
 
Rank description =
SWITCH( TRUE(),
[Avg. Rating Ranking Desc] = 1, "Top 1",
[Avg. Rating Ranking Desc] = 2, "Top 2",
[Avg. Rating Ranking Desc] = 3, "Top 3",
[Avg. Rating Ranking Desc] = 10, "Bottom 1",
[Avg. Rating Ranking Desc] = 9, "Bottom 2",
[Avg. Rating Ranking Desc] = 8, "Bottom 3",
BLANK())
 
Picture1.pngPicture2.png
 
 
Did I answer your question? Mark my post as a solution! Appreciate your Kudos!!

If this post helps, then please consider accepting it as the solution to help other members find it faster, and give a big thumbs up.


Go to My LinkedIn Page


View solution in original post

4 REPLIES 4
Jihwan_Kim
Super User
Super User

Hi, @Anonymous 

If it is OK with you, please share the sample pbix file or sample data.

It will be very much helpful if I can see the sample to come up with a desirable outcome with possible solutions.

 

Thank you very much.

 

If this post helps, then please consider accepting it as the solution to help other members find it faster, and give a big thumbs up.


Go to My LinkedIn Page


Anonymous
Not applicable

Hi, @Anonymous  

Thank you very much for sharing.

I hope I come up with what you needed.

 

I unpivoted your original table to look like the below in order to calculate numbers per each category.

Then I wrote two measures like below.
You can also check some other measures in the PBIX file that I have connected to the link below.

 

Avg. Rating Ranking Desc =
RANKX( ALL(Data[Category]), [Avg. Rating],,DESC)
 
Rank description =
SWITCH( TRUE(),
[Avg. Rating Ranking Desc] = 1, "Top 1",
[Avg. Rating Ranking Desc] = 2, "Top 2",
[Avg. Rating Ranking Desc] = 3, "Top 3",
[Avg. Rating Ranking Desc] = 10, "Bottom 1",
[Avg. Rating Ranking Desc] = 9, "Bottom 2",
[Avg. Rating Ranking Desc] = 8, "Bottom 3",
BLANK())
 
Picture1.pngPicture2.png
 
 
Did I answer your question? Mark my post as a solution! Appreciate your Kudos!!

If this post helps, then please consider accepting it as the solution to help other members find it faster, and give a big thumbs up.


Go to My LinkedIn Page


Anonymous
Not applicable

This works perfectly! Thank you - marked as solution

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.