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

Grow your Fabric skills and prepare for the DP-600 certification exam by completing the latest Microsoft Fabric challenge.

Reply
SamTrott
Helper I
Helper I

Show only top 5 Categories and top 5 Sub-Categories on Chart

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:

slide10excel.png

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. 

6 REPLIES 6

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. 

@SamTrott 

 

You may also try to create a calculated table first.

Community Support Team _ Sam Zha
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
tex628
Community Champion
Community Champion

Can you post your two measures? 

/ J


Connect on LinkedIn

Measure 1: 

Rank Category by closed incidents = RANKX(ALL(IncidentsClosed[Category]),[Count of Incidents Closed])
 
Measure 2:
Rank Sub-Category by closed incidents = RANKX(ALL(IncidentsClosed[Sub-Category]),[Count of Incidents Closed])
 
Both Measures are looking at the respective fields. But I had to put both Fields into a heirarchy to display non Cancatenated labels, not sure if relevant but there you go. 
 
 
tex628
Community Champion
Community Champion

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


Connect on LinkedIn

Helpful resources

Announcements
Europe Fabric Conference

Europe’s largest Microsoft Fabric Community Conference

Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.

RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.

MayPowerBICarousel1

Power BI Monthly Update - May 2024

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