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
In my date I have two fields, one for Category and one for sub-category, I want to have a chart that only show the top 5 Categories and then the top 5 Sub-Categories. In excel it looks like this:
I wrote two measures one to rank Category and one to rank Sub-Category and these work when I just have one Axis but not with both. I think I need some kind of measure that ranks heirarchy but unsure on how to accomplish this.
What do I need to do to get the chart in BI to display similar to the Excel version.
@SamTrott , refer if this can help
https://www.sqlbi.com/articles/filtering-the-top-3-products-for-each-category-in-power-bi/
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
That may be what I need but I'm having a hard time relating it to mine since the examples deal with numeric values in fields instead of Counting of instances. Still leaves me unsure of how to write the measure to work with my data.
You may also try to create a calculated table first.
Measure 1:
When you are applying that ALL() to Sub-Category you are removing the main category filter, meaning that you are creating a rank over all subcategories. I think you need to use a selectedvalue() to get the main category, then filter the IncidentsClosed table again.
Ive got a meeting but ill take a better look at this after!
/ J
The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!
Check out the November 2025 Power BI update to learn about new features.
| User | Count |
|---|---|
| 59 | |
| 43 | |
| 42 | |
| 23 | |
| 17 |
| User | Count |
|---|---|
| 190 | |
| 122 | |
| 96 | |
| 66 | |
| 47 |