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

Power BI is turning 10! Let’s celebrate together with dataviz contests, interactive sessions, and giveaways. Register now.

Reply
AFriendlyMonkey
Regular Visitor

Creating Hierarchy Slicer for Bar Chart with Field Parameters

At the highest level, this is what my bar chart should look like:

AFriendlyMonkey_0-1710953157605.png

 

In the data each row is an area with a Loc (the field name), ID1, and ID2. These values are hierarchical, so each Loc (field name) may have 1-5 ID1 values, and each ID1 may hav 1-10 ID2 values. 

 

I want to use a slicer to allow users to quickly switch the x-axis and traverse through the hierarchy.

For example, if a user wanted to view ID1, they would see the following.

AFriendlyMonkey_7-1710954506115.png

 

Using the drill-down and drill-up buttons is confusing, and I just want it to be easy for the user to switch between these values.

 

Currently I have attempted to use field parameters to achieve this:

I followed this Guy in a Cube tutorial: https://www.youtube.com/watch?v=5G_xSJy5muo 

 

I created a field parameter called Location with the following code:

AFriendlyMonkey_2-1710953674701.png

 

When I create the slicer I put Value4 in the slicer:

AFriendlyMonkey_6-1710954364086.png

 

But if I select ID1, it only shows ID1 without the fields:

AFriendlyMonkey_4-1710954317315.png

 

How do I reconcile this so that I can use field parameters to navigate through the hierarchy and show numerous levels on the x-axis of the bar chart?

2 REPLIES 2
Anonymous
Not applicable

Hi @AFriendlyMonkey ,

 

First, make sure that the hierarchical relationships between Loc1, ID1, and ID2 are properly defined in the data model.

 

Since in Power BI Desktop, dates are automatically created in the hierarchy, the rest may need to be set up by you according to your needs.

 

You can refer to this step by step:

 

1. Select More Options on the right side of Loc and then select Create hierarchy.

vhuijieymsft_0-1711004456265.png

vhuijieymsft_1-1711004388250.png

 

2. Select More Options on the right side of ID1 and ID2 and then select Add to hierarchy and then select the hierarchy you just created.

vhuijieymsft_2-1711004388251.png

 

Second, instead of using a standard slicer with field parameters, consider using a hierarchy slicer.

 

Hierarchy slicers allow you to visualize and navigate hierarchical data more intuitively.

 

You can create a hierarchical slicer by adding fields (Loc, ID1, ID2) to the slicer visual object and arranging them in hierarchical order.

 

For more information about the Hierarchy Slicer, see the following documentation:

Add multiple fields to a hierarchy slicer - Power BI | Microsoft Learn

 

If you have any further questions please feel free to contact me.

 

Best Regards,
Yang
Community Support Team

 

If there is any post helps, then please consider Accept it as the solution  to help the other members find it more quickly.
If I misunderstand your needs or you still have problems on it, please feel free to let us know. Thanks a lot!

This solution does not produce the slicer I want. When I follow your instructions I end up with a slicer like this:

AFriendlyMonkey_0-1711032290233.png

 

The variable in my y-axis is a measure, so I want it to summarize the information at either a Field, ID1, or ID2 level. With the slicer you made, the user can select specific fields, but it still must also show ID1 and ID2 with the field.

 

I would rather the slicer appear like this (the one made with the tutorial):

AFriendlyMonkey_2-1711032507070.png

 

So I want the user to choose the lowest level of the hierarchy that the graph displays. For example, if ID1 is chosen, I want it to still show the field as well:

AFriendlyMonkey_3-1711032658920.png

 

Because the IDs can repeat on different fields, it is useless to summarize to only ID1 or ID2. The best solution I found was simulating a hierarchy with a dynamic slicer, but this seems to only show the lowest level and is described by the problem in the past sentence.

 

If there is a solution to choose the level of hierarchy displayed with a slicer, that would be perfect.

Helpful resources

Announcements
June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

Check out the June 2025 Power BI update to learn about new features.

June 2025 community update carousel

Fabric Community Update - June 2025

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