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

Vote for your favorite vizzies from the Power BI Dataviz World Championship submissions. Vote now!

Reply
janstrauss1
Advocate I
Advocate I

How to set intuitive filtering by category hierarchy?

Dear Power BI Community,

 

I’m trying to build a user-friendly report with a hierarchy slicer that allows for filtering and aggregating values based on different levels of a ragged classification hierarchy.

 

I’ve created a fully reproducible example (ReprEx) including example data that you can find on my GitHub.

 

The final report should give something like the following results:

 

Screenshot 2023-11-21 110653.png

 

While the filtering using either the standard slicer or custom HierarchySlicer works in general, I find it not very intuitive for the user. However, I’m struggling to improve it. Specifically, when I select a category from the third level (e. g., 301 Building of ships and boats), then values for this category and all its subcategories are summed leading to double counting and wrong numbers in the line chart visual:

 

Screenshot 2023-11-21 110853.png

 

What I’d like to achieve is a slicer with blanks removed that shows the same filtering behaviour and results as in the first report screenshot when selecting the fourth level (Blank) but when selecting the third level category 301 Building of ships and boats.

Currently I can only achieve this by multiple selection of the subcategories using CTRL + Select like so:

Screenshot 2023-11-21 115646.png

 

I appreciate any help and suggestions how to achieve this.

 

Many thanks in advance!

1 ACCEPTED SOLUTION
janstrauss1
Advocate I
Advocate I

Dear Power BI Community,

 

I managed to solve my problem after I realized that I need to simply filter for the lowest level of my hierarchy to achieve correct aggregation of my values using my hierarchy slicer.

 

I've updated the reproducible example (ReprEx) available on my GitHub, where create a table using DAX that I use for the line chart visual:

 

ReprEx_FactTable_Level5filtered = 
    FILTER(
        ReprEx_FactTable, 
        LEN([WZ08_Code]) = 5
    )

 

Screenshot 2023-11-22 102223.png

 

View solution in original post

1 REPLY 1
janstrauss1
Advocate I
Advocate I

Dear Power BI Community,

 

I managed to solve my problem after I realized that I need to simply filter for the lowest level of my hierarchy to achieve correct aggregation of my values using my hierarchy slicer.

 

I've updated the reproducible example (ReprEx) available on my GitHub, where create a table using DAX that I use for the line chart visual:

 

ReprEx_FactTable_Level5filtered = 
    FILTER(
        ReprEx_FactTable, 
        LEN([WZ08_Code]) = 5
    )

 

Screenshot 2023-11-22 102223.png

 

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

Vote for your favorite vizzies from the Power BI World Championship submissions!

Sticker Challenge 2026 Carousel

Join our Community Sticker Challenge 2026

If you love stickers, then you will definitely want to check out our Community Sticker Challenge!

January Power BI Update Carousel

Power BI Monthly Update - January 2026

Check out the January 2026 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.