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

Microsoft is giving away 50,000 FREE Microsoft Certification exam vouchers. Get Fabric certified for FREE! Learn more

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
v-tangjie-msft
Community Support
Community Support

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
v-tangjie-msft
Community Support
Community Support

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
PBIApril_Carousel

Power BI Monthly Update - April 2025

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

Notebook Gallery Carousel1

NEW! Community Notebooks Gallery

Explore and share Fabric Notebooks to boost Power BI insights in the new community notebooks gallery.

April2025 Carousel

Fabric Community Update - April 2025

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

Top Solution Authors