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
DAXUser
Frequent Visitor

Display top 10 product without using dense and skip ranking

Hi,

 

ProductTotal CountRankExpected Output
Screw6911
Spanners6822
Clutch6823
Cross6734
External Hex6645
Hex Socket6556
Square Socket6467
Tamper Resistant Hex6378
Torx6289
Slotted61910
One way601011
Plain601012
JIS601013

 

As you can see, I have a total count for each product in the table. I used the dense ranking based on the number of products. Now my requirement is I want to display first 10 products from the table which means I want to display continues number(1 to 10) similar to expected output column so that I will apply a filter on top of expected output column to get first 10 products.

2 ACCEPTED SOLUTIONS
amitchandak
Super User
Super User

@DAXUser , if this for meausre refer tie breaker

 

Rank Tie breaker
https://community.powerbi.com/t5/Community-Blog/Breaking-Ties-in-Rankings-with-RANKX-Using-Multiple-...
https://databear.com/how-to-use-the-dax-rankx-function-in-power-bi/

 

 

But if this column, then consider

Power Query Table.AddRankColumn : https://youtu.be/bnB1rgAhZaw

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

View solution in original post

tamerj1
Super User
Super User

Hi @DAXUser 
Please refer to attached sample file. You can use TOPN function in this case as folows (unless you need to show the rank in the visual):

Place the filter measure in the filter pane of the visual, select "is not blank" then apply the filter.

1.png

Top 10 Filter = 
IF ( 
    SELECTEDVALUE ( Products[Product] )
        IN TOPN ( 
            10,
            ALLSELECTED ( Products[Product] ),
            [Total Count],,
            Products[Product]
        ),
    1
)

 

 

 

View solution in original post

2 REPLIES 2
tamerj1
Super User
Super User

Hi @DAXUser 
Please refer to attached sample file. You can use TOPN function in this case as folows (unless you need to show the rank in the visual):

Place the filter measure in the filter pane of the visual, select "is not blank" then apply the filter.

1.png

Top 10 Filter = 
IF ( 
    SELECTEDVALUE ( Products[Product] )
        IN TOPN ( 
            10,
            ALLSELECTED ( Products[Product] ),
            [Total Count],,
            Products[Product]
        ),
    1
)

 

 

 

amitchandak
Super User
Super User

@DAXUser , if this for meausre refer tie breaker

 

Rank Tie breaker
https://community.powerbi.com/t5/Community-Blog/Breaking-Ties-in-Rankings-with-RANKX-Using-Multiple-...
https://databear.com/how-to-use-the-dax-rankx-function-in-power-bi/

 

 

But if this column, then consider

Power Query Table.AddRankColumn : https://youtu.be/bnB1rgAhZaw

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

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.