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

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes! Register now.

Reply
ryan_aicd2
New Member

Issue with SELECTEDVALUE and SWITCH

Hello

I have a simple table (manual) in PBI that has 1 column and 3 values (Region, Segment, Market). With this table, I want to have a Slicer that will allow people to select 1 of the 3 values and use that value as a basis to select a column dynamically in the main Orders table. Here is the DAX code:

Dynamic Selection = 
VAR SelectedParameter = SELECTEDVALUE('Slicer'[Parameter])
RETURN
SWITCH(
    TRUE(),
    SelectedParameter = "Region", 'Orders'[Region],
    SelectedParameter = "Market", 'Orders'[Market],
    SelectedParameter = "Segment", 'Orders'[Segment]
)

 

There is no relationship between Orders and Slicer. I then have a chart with Dynamic Selection in the Legend to do the dynamic level of detail change. But, it resolves to blank no matter the selection I do.

ryan_aicd2_0-1699235964879.png

ryan_aicd2_1-1699236125601.png

 

Help with this greatly appreciated. 



 

1 ACCEPTED SOLUTION
OwenAuger
Super User
Super User

Hi @ryan_aicd2 

Calculated columns are static, and normally only "processed" on dataset refresh. They cannot respond to filters applied in a report.

 

Instead, you can use the field parameters feature to select a particular column (or measure) to be used in a visual.

https://learn.microsoft.com/en-us/power-bi/create-reports/power-bi-field-parameters

 

In this example, you would create a field parameter containing the three columns Region, Market, & Segment. Then place the field parameter column in the "Legend" field well.

 

Please post back if needed.

 

Regards


Owen Auger
Did I answer your question? Mark my post as a solution!
Blog
LinkedIn

View solution in original post

2 REPLIES 2
OwenAuger
Super User
Super User

Hi @ryan_aicd2 

Calculated columns are static, and normally only "processed" on dataset refresh. They cannot respond to filters applied in a report.

 

Instead, you can use the field parameters feature to select a particular column (or measure) to be used in a visual.

https://learn.microsoft.com/en-us/power-bi/create-reports/power-bi-field-parameters

 

In this example, you would create a field parameter containing the three columns Region, Market, & Segment. Then place the field parameter column in the "Legend" field well.

 

Please post back if needed.

 

Regards


Owen Auger
Did I answer your question? Mark my post as a solution!
Blog
LinkedIn

Haha I honestly spent ages trying to find the field parameter and didn't realise it was a server level setting to enable. I wondered why there was only numeric ones and that is why I had to go this route. Thanks heaps.

Helpful resources

Announcements
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

September Power BI Update Carousel

Power BI Monthly Update - September 2025

Check out the September 2025 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.