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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
Gatanka
Frequent Visitor

Using a slicer to define legend range (or hierarchy?)

Hi there,

 

I've built a stacked area graph based on demand for different food types.  Each category is defined at three levels: Level 1 (Vegetarian/Non-veretarian), Level 2 (fruit, vegetable...), and Level 3 (apple, bannana....).

 

I'd like the user to be able to view this data at each of the three levels, depending on thier preference. 

 

I've tried setting up the "Level" as part of a hierarchy, but when I try to drill up/down I only manage to interrogate the date hierarchy. I'd be equally satisfied if the "Level" could be defined by a slicer.  I thought I'd found a way to do this by using a DAX expression to dynamically filter the column in the legend field, but so far nothing I've done has worked. 

 

Below is an example showing what I'm trying to model.  Clockwise from top right shows that three "levels" I want the user to be able to select - I'd just like it to be available in one visual. Sample screen grabs of my data tables also below. 

Gatanka_4-1673600707962.png

 

Gatanka_2-1673600478717.png Gatanka_3-1673600504207.png

 

 

1 ACCEPTED SOLUTION
johnt75
Super User
Super User

Create a field parameter which includes the three levels and use that on the slicer and in the legend.

View solution in original post

2 REPLIES 2
Gatanka
Frequent Visitor

Field parameters!

Sir, you've just saved my bacon! That is exactly the functionality I was looking for.  Thank you for your response and letting me get on with the rest of my day! 🙂

johnt75
Super User
Super User

Create a field parameter which includes the three levels and use that on the slicer and in the legend.

Helpful resources

Announcements
RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

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

MayPowerBICarousel

Power BI Monthly Update - May 2024

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

LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.