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

Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started

Reply
RNZALR
Helper I
Helper I

Returning Top and Bottom 10 Ranked Items

Hello,

 

I am buildinga report for a sports organisation.  We've come up with a methodology that ranks clubs.  The methodology currently covers three different facets of the clubs at the moment.  Those being Future Club Prospects, Club Popularity and Club Support.  Each club is ranked against each of three facets separately and then the governing body can determine a weighting for each facet.  For example, Future Prospects might have a weighting of 50%, Popularity might be weighted at 30% and Support is therefore 20%.  Each of the three separate rankings is multiplied by their weighting and all three are added together to generate a score.  I then want to rank all clubs by their score.  

 

The above is working well for me with the dax I have posted below.  However, I'd like to modify it to only return a table that shows the Top 10 Clubs who would be deemed to be 'Thriving'.  I'd also like to return a second table that only shows the Bottom 10 Clubs who would be deemed to be 'At Risk'.

 

I am struggling to return the two separate tables I need above.  Can someone please assist?

 

This is my dax to determine each club's score:

 

Score =
var Score =
    ([4Yr Player Pool Share Rankings] * SELECTEDVALUE('Share of Playing Pool Weighting'[Selected Weighting])) +
    ([4Yr Youth & Senior Growth Rankings] * SELECTEDVALUE('Share of Youth & Senior Growth Weighting'[Selected Weighting])) +
    ([4Yr Weighted Player to Volunteer Rankings] * SELECTEDVALUE('Share of Player to Volunteer Ratio Weighting'[Selected Weighting]))
return
    Score
 
This is my dax to then rank each club based on their score:
 
Rank = RANKX( ALL(Clubs[Club Name] ), CALCULATE([Score]),,DESC)
 
Many thanks in advance!

 

1 ACCEPTED SOLUTION

Hi, 

thank you very much for your message.

If it is OK with you, please share your sample pbix file's link (onedrive, googledrive, dropbox, others), and then I can try to come up with a more accurate solution that meets your requirement.

Thank you.

 

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.


Visit my LinkedIn page by clicking here.


Schedule a meeting with me to discuss further by clicking here.

View solution in original post

3 REPLIES 3
Jihwan_Kim
Super User
Super User

Hi,

I assume [Score] is a measure and you want to create table visualization.

Please try to write a measure something like below.

 

 

Top 10 rank measure: =
CALCULATE (
    [Score],
    KEEPFILTERS ( TOPN ( 10, ALL ( Clubs[Club Name] ), [Score], DESC ) )
)

 

 

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.


Visit my LinkedIn page by clicking here.


Schedule a meeting with me to discuss further by clicking here.

Hi Jihwan,

 

That is very nearly the answer I think.  I am getting a few issues though:

 

  1. The value being returned appears to be a score rather than a ranking number.  I'd like it to be a rank as this is easily understanding to the user.
  2. All clubs after the top 10 continue to appear and have been given a score of 1.  I'd like them to vanish completely so that the list only returns 10.  I know I could filter them out in the filter pane by removing values that = 1 but I presume there is a better way.
  3. The list returned differs in order from the list I have already got set up as a heat map.  Below is a screen shot of what I am getting.  I have a slicer on the page and have set it to the 2022 season.  My matrix ranks all clubs from 1 down to the very last club.  This is done using the Club names in the Rows and the dax measure called Rank that I shared in my original post.  On top and to the right I've put a table using the Club names again but this time the measure is the dax you gave me above called Top 10 Rank.  You'll note:
    1. The clubs in the top 10 in both lists are the same
    2. The order in which they appear in each list is different.  I would like them to be in the same order and I'd preferably like the ranking shown rather than a score which to be honest, I don't really recognise.

Your thoughts would be greatly appreciated!

RNZALR_0-1674552248536.png

 

Hi, 

thank you very much for your message.

If it is OK with you, please share your sample pbix file's link (onedrive, googledrive, dropbox, others), and then I can try to come up with a more accurate solution that meets your requirement.

Thank you.

 

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.


Visit my LinkedIn page by clicking here.


Schedule a meeting with me to discuss further by clicking here.

Helpful resources

Announcements
Sept PBI Carousel

Power BI Monthly Update - September 2024

Check out the September 2024 Power BI update to learn about new features.

September Hackathon Carousel

Microsoft Fabric & AI Learning Hackathon

Learn from experts, get hands-on experience, and win awesome prizes.

Sept NL Carousel

Fabric Community Update - September 2024

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