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

Get inspired! Check out the entries from the Power BI DataViz World Championships preliminary rounds and give kudos to your favorites. View the vizzies.

Reply
LeverPowerCLiff
Frequent Visitor

Select Parameter Fields Using Another Slicer

Hi

 

I wish to change the parameter fields one of my graphs shows based on the sector selected on a separate filter on the same page. 

I.e. For Sector A and B I want to show measures X, Y and Z but for Sector C I want the graph to show measures V and W

 

I'm sure there are workarounds with buttons and bookmarks with multiple charts but I would prefer to avoid these.

What I have tried is making a measure:

Filter =

var _selectedMeas = SELECTEDVALUE(ParameterFields[Parameter Fields])
var _SectorCSelec = IF(SELECTEDVALUE(Sector) = "Sector C", 1, 0)
var _NotSectorCSelec = IF(SELECTEDVALUE(Sector) = "Sector C", 0, 1)
return
SWITCH(
    TRUE(),
    _selectedMeas = Measure V, _SectorCSelec,
    _selectedMeas = Measure W, _SectorCSelec,
   _NotSectorCSelec
)
 
And then applying this as a filter to the graph, include if Filter = 1. This works as a way of sorting the slicer, e.g. if sector A is selected the only selectable measures are X, Y and Z but the selectedvalue(parameter) part does not work on the graph, the final part of the switch function is always returned so it shows all measures for sectors A and B but no measures when Sector C is selected.
 
Is there a change I can make such that the graph switches between these measures based on the sector selected?
 
Many thanks,
1 REPLY 1
Anonymous
Not applicable

Hi @LeverPowerCLiff ,

In order to better understand your demands and give the right solution, could you please provide some more specific information? such as your desensitized example data and a screenshot of your desired results?

Thanks for your efforts & time in advance.

 

Best regards,
Community Support Team_Binbin Yu

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

FebPBI_Carousel

Power BI Monthly Update - February 2025

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

Feb2025 NL Carousel

Fabric Community Update - February 2025

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

Top Kudoed Authors