Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more
Hi All, I want to show top 5 categories with YTD and Total. I wan to show top categories based on Total not based on YTD.
Solved! Go to Solution.
You can have ytd like
YTD Sales = CALCULATE(SUM(Sales[Sales Amount]),DATESYTD('Date'[Date],"12/31"))
overall Sales = CALCULATE(SUM(Sales[Sales Amount]),all('Date'))
On overall sales you can have rank or top N for category and filter
Top 5 category Rank = CALCULATE([overall Sales],TOPN(10,all(Item[category ]),[overall Sales],DESC),VALUES(Geography[Item category ]))
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
https://community.powerbi.com/t5/Community-Blog/Dynamic-TopN-made-easy-with-What-If-Parameter/ba-p/3...
You can have ytd like
YTD Sales = CALCULATE(SUM(Sales[Sales Amount]),DATESYTD('Date'[Date],"12/31"))
overall Sales = CALCULATE(SUM(Sales[Sales Amount]),all('Date'))
On overall sales you can have rank or top N for category and filter
Top 5 category Rank = CALCULATE([overall Sales],TOPN(10,all(Item[category ]),[overall Sales],DESC),VALUES(Geography[Item category ]))
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
https://community.powerbi.com/t5/Community-Blog/Dynamic-TopN-made-easy-with-What-If-Parameter/ba-p/3...
Check out the November 2025 Power BI update to learn about new features.
Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!
| User | Count |
|---|---|
| 58 | |
| 45 | |
| 42 | |
| 21 | |
| 18 |
| User | Count |
|---|---|
| 172 | |
| 107 | |
| 92 | |
| 54 | |
| 46 |