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

The Power BI DataViz World Championships are on! With four chances to enter, you could win a spot in the LIVE Grand Finale in Las Vegas. Show off your skills.

Reply
PowerBIFan5
Frequent Visitor

Next Top 5 Ranked

Hello, I am trying to be able to show the next top 5 ranked items based on the item selected in a slicer for the page. For example, if the selected item is ranked 6, I want to be able to show who is 7,8,9,10,11. This is using a direct query as a data source so data transformation is limited. I can request to add tables if needed. Ideally, in the end, I will be able to have a card that would show item 7, and then another card that would show item 8, etc. I want to also be able to show associated metrics of these next ranked items. Thank you!

1 ACCEPTED SOLUTION

Hi @PowerBIFan5 ,
As per your earlier post, you need to use the slicer as the basis for your selection, and if you don't want to enter it manually you can use hardcoding to specify the range of rankings you need to display.

Top5 = 
IF(
    Table_1[Rank] > 6 && Table_1[Rank] <= 11,
        1,
        0
)

Similar to the 6, and 11 here.

Best regards,
Albert He


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

8 REPLIES 8
v-heq-msft
Community Support
Community Support

Hi  @PowerBIFan5  ,
You can try the following steps:
Sample data

vheqmsft_0-1728356557480.png
Create measure

Rank = RANKX(ALL(Table_1),CALCULATE(SUM(Table_1[Value])),,ASC,Dense)

Create a calculate table(There are thirteen pieces of test data above, if you have duplicates, based on your largest
RANK value)

SlicerTable = GENERATESERIES(1, 13, 1)

Create measures

Top5 = 
IF(
    Table_1[Rank] > SELECTEDVALUE(SlicerTable[Value]) && Table_1[Rank] <= SELECTEDVALUE(SlicerTable[Value]) + 5,
        1,
        0
)
Rank+1 = 
CALCULATE(
    MAX(Table_1[Nmae]),
    FILTER(
        Table_1,
        Table_1[Rank] = SELECTEDVALUE(SlicerTable[Value]) +1
    )
)
Rank+2 = 
CALCULATE(
    MAX(Table_1[Nmae]),
    FILTER(
        Table_1,
        Table_1[Rank] = SELECTEDVALUE(SlicerTable[Value]) +2
    )
)

Apply the Top5 to table filter 

vheqmsft_1-1728356693674.png


Final output 

vheqmsft_2-1728356704525.png

 

Best regards,
Albert He


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

 

 

 

 

 

Hi Albert, Thank you for taking the time to send over this method! Would I always have to input the value into the slicer manually or is there a way to make the slicer value dynamic based on the selected item's rank?

Hi @PowerBIFan5 ,
As per your earlier post, you need to use the slicer as the basis for your selection, and if you don't want to enter it manually you can use hardcoding to specify the range of rankings you need to display.

Top5 = 
IF(
    Table_1[Rank] > 6 && Table_1[Rank] <= 11,
        1,
        0
)

Similar to the 6, and 11 here.

Best regards,
Albert He


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

 

Hi Albert, Thank you for taking the time to explain - makes sense. I needed something that would be dynamic since the selected item rank will change depending on what's selected.  I ended up solving the issue using a duplicate fact table.

Ashish_Mathur
Super User
Super User

Hi,

I may be able to generate a table (not different card visuals).  I would like to try.  Share some data and show the expected result.  Share data in a format that can be pasted in an MS Excel file.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

Thanks Ashish, I ended up solving the issue using a duplicate fact table so I am all set now.

lbendlin
Super User
Super User

Why not just list all of them in a table with their rank as a column?  Let the report user's eyes do the work.

Thank you for the idea. I kept that in mind for a backup but I ended up solving the issue so I could display it as requested.

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

FebPBI_Carousel

Power BI Monthly Update - February 2025

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

Feb2025 NL Carousel

Fabric Community Update - February 2025

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