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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
Anonymous
Not applicable

Rank and transpose in table or matrix

Hi!

 

I need some help to solve this problem. I have a list with the following columns: company name, year and profit. The list looks like this:

 

List.PNG

 

Then I would like to rank the top 3, and the bottom 3 (each year) like this(for the top 3):

RankedList.PNG

 

..and like this for the bottom 3 (where the company ranked as 1 is the worst performing company):

RankedListBottom.PNG

 

Thanks in advance for any help solving this challenge!

 

 

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

@Anonymous ,

 

Create two calculate columns using DAX below:

 

Rank_Best = RANKX(FILTER('Table', 'Table'[Year] = EARLIER('Table'[Year])), 'Table'[Profit], , DESC, Dense)
Rank_Worst = RANKX(FILTER('Table', 'Table'[Year] = EARLIER('Table'[Year])), 'Table'[Profit], , ASC, Dense)

Then create two matrix visuals as below:

Capture.PNG 

 

Community Support Team _ Jimmy Tao

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

 

View solution in original post

2 REPLIES 2
v-yuta-msft
Community Support
Community Support

@Anonymous ,

 

Create two calculate columns using DAX below:

 

Rank_Best = RANKX(FILTER('Table', 'Table'[Year] = EARLIER('Table'[Year])), 'Table'[Profit], , DESC, Dense)
Rank_Worst = RANKX(FILTER('Table', 'Table'[Year] = EARLIER('Table'[Year])), 'Table'[Profit], , ASC, Dense)

Then create two matrix visuals as below:

Capture.PNG 

 

Community Support Team _ Jimmy Tao

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

 

Anonymous
Not applicable

@v-yuta-msft 

 

Thank you very much for the solution!

 

PS! I see now that my question was a bit too simplified regarding my actual case, but I'll send the challenge in a new post since this one is solved.

 

Thanks once again!!

Helpful resources

Announcements
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.