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

The Power BI Data Visualization World Championships is back! It's time to submit your entry. Live now!

Reply
Suhel_Ansari
Helper V
Helper V

Category and Subcategory TOP 5 Rank without Tie Break

keep only the inHi All,

I have the Report where I Need the Top 5 Veh_Models and Top 1 Veh_Details in a table I have tired TOPN for Veh_Models within the Visuals and cretaed a Measure [Top 1 Veh_Details] as follows, It's working fine whowhen i try to filter via country slicer we have a ties it's shown me the Top all the Veh_Details rows with ties however I need to keep only the Top 1.

Please asssit me how can I get only the Top 1 Record for the Veh_Details . Thanks

 

Counts = CALCULATE( COUNTROWS('Dataset'))

 

Top 1 Veh_Details =
VAR Rank5 = RANKX( ALLSELECTED('Dataset'[Vehicle_Detailed_Model]) , [Counts],,DESC,Skip)
VAR Result = IF( Rank5 = 1 , 1 )
RETURN
Result

 

Suhel_Ansari_0-1700739985417.png

 

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @Suhel_Ansari ,

 

According to your description, here are my steps you can follow as a solution.

(1) This is my test data. 

vtangjiemsft_0-1701065910487.png

(2) We can create a measure. 

Top 1 Veh_Details = 
VAR Rank5 = RANKX(ALLSELECTED('Dataset'),[Counts],,DESC,Skip)
VAR Result = IF( Rank5 = 1 , 1,BLANK() )
RETURN
IF(Result=1,MAX('Dataset'[detail]),BLANK())

(3) Then the result is as follows.

vtangjiemsft_1-1701066298995.png

 

If the above one can't help you get the desired result, please provide some sample data in your tables (exclude sensitive data) with Text format and your expected result with backend logic and special examples. It is better if you can share a simplified pbix file. Thank you.

 

Best Regards,

Neeko Tang

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

Hi @Suhel_Ansari ,

 

According to your description, here are my steps you can follow as a solution.

(1) This is my test data. 

vtangjiemsft_0-1701065910487.png

(2) We can create a measure. 

Top 1 Veh_Details = 
VAR Rank5 = RANKX(ALLSELECTED('Dataset'),[Counts],,DESC,Skip)
VAR Result = IF( Rank5 = 1 , 1,BLANK() )
RETURN
IF(Result=1,MAX('Dataset'[detail]),BLANK())

(3) Then the result is as follows.

vtangjiemsft_1-1701066298995.png

 

If the above one can't help you get the desired result, please provide some sample data in your tables (exclude sensitive data) with Text format and your expected result with backend logic and special examples. It is better if you can share a simplified pbix file. Thank you.

 

Best Regards,

Neeko Tang

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

Suhel_Ansari
Helper V
Helper V

@amitchandak 

@Greg_Deckler 

@ChandeepChhabra 

 

Please assist 🙏

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! It's time to submit your entry.

January Power BI Update Carousel

Power BI Monthly Update - January 2026

Check out the January 2026 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.