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

Get certified in Microsoft Fabric—for free! For a limited time, get a free DP-600 exam voucher to use by the end of 2024. Register now

Reply
Anonymous
Not applicable

Need help in Rankx dax for top 7 in each catagory

PBIX dummy pix.pngHi Team,

I'm new in Power BI. I just need help to show top 7 in each catagory like first in bar graph it shows top 7 for major then top 7 for catagory and then top 7 for sub catagory.

Please help me with dax.

7 REPLIES 7
amitchandak
Super User
Super User

@Anonymous , Refer:

https://www.sqlbi.com/articles/filtering-the-top-3-products-for-each-category-in-power-bi/

You can change to make it work on 7

Also

For Rank Refer these links
https://radacad.com/how-to-use-rankx-in-dax-part-2-of-3-calculated-measures
https://radacad.com/how-to-use-rankx-in-dax-part-1-of-3-calculated-columns
https://radacad.com/how-to-use-rankx-in-dax-part-3-of-3-the-finale

Join us as experts from around the world come together to shape the future of data and AI!
At the Microsoft Analytics Community Conference, global leaders and influential voices are stepping up to share their knowledge and help you master the latest in Microsoft Fabric, Copilot, and Purview.
️ November 12th-14th, 2024
 Online Event
Register Here
Anonymous
Not applicable

Hi Amit,

 

Thanks for your response. i've tried this one but it's not working for bar graph. i have added a screenshot please have a look and confirm if you have any solution for my problem.

Have you created a Sub Category Rank (As per the topic name, not the name of your column) in desc order and filter it on <=7 in visual ?

 

Join us as experts from around the world come together to shape the future of data and AI!
At the Microsoft Analytics Community Conference, global leaders and influential voices are stepping up to share their knowledge and help you master the latest in Microsoft Fabric, Copilot, and Purview.
️ November 12th-14th, 2024
 Online Event
Register Here

Hi @Anonymous ,

 

After my continuous attempts, I still cannot use dax to meet your needs. There is an issue with my dax. After I drill down,

Subcategories of the parent category that are not in the topn range are also displayed. I hope someone can offer us a better way or modify my dax.

 

And  would you please vote for the similar idea in Power BI forum which has been submitted to improve Power BI and make this feature coming sooner.

 

Here is my pbix file: https://qiuyunus-my.sharepoint.com/:u:/g/personal/pbipro_qiuyunus_onmicrosoft_com/EWpxul-2yftOmmkUh-bFV9oBj7jlJQHumeCCDJpC8r9ahg?e=YqA1N8

 

Best Regards,

Dedmon Dai

Anonymous
Not applicable

Thanks @v-deddai1-msft ,

I have voted it and lets wait for it.. 

but it required in so many cases... so Power BI team will have to look in to it ASAP.

Anonymous
Not applicable

Yes.. i have created it.. i just want to show top 7 bars on every level,,

Anonymous
Not applicable

Hi Users,

Please help me with my query.. as i just want to filter top 7 with every axis level visual..  

Helpful resources

Announcements
November Carousel

Fabric Community Update - November 2024

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

Live Sessions with Fabric DB

Be one of the first to start using Fabric Databases

Starting December 3, join live sessions with database experts and the Fabric product team to learn just how easy it is to get started.

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! Early Bird pricing ends December 9th.

Nov PBI Update Carousel

Power BI Monthly Update - November 2024

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