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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
JileMeyn
New Member

DAX function with Slicers

I have three slicers:

  1. Department
  2. Location
  3. Senior Manager

I currently have it set up to have my tables appear blank until Location is selected by using this funtion:

 

Blank = IF(ISFILTERED(Master[Location]), 1,0)
 
Then having a filter on the Visual for 1.
 
But there are 4 locations where I need the user to select a senior manager before it will display the information. I got it to work for one location using a SWITCH expression but how do I add on the 3 additional locations to a SELECTEDVALUE?
 
Senior Blank = SWITCH(SELECTEDVALUE(Master[Location]), "YYC", IF(ISFILTERED(Master[SR Manager]),1,0), if(ISFILTERED(Master[Location]),1,0))
 
1 ACCEPTED SOLUTION
JileMeyn
New Member

I figured it out, for anyone else that needs help with the issue this was the expression that worked.

 

Senior Blank = SWITCH(SELECTEDVALUE(Master[Location]),"YYC", IF(ISFILTERED(Master[SR Manager]),1,0),"YUL",IF(ISFILTERED(Master[SR Manager]),1,0),"YMX", IF(ISFILTERED(Master[SR Manager]),1,0),"YYZR", IF(ISFILTERED(Master[SR Manager]),1,0), if(ISFILTERED(Master[Location]),1,0))

View solution in original post

3 REPLIES 3
JileMeyn
New Member

I figured it out, for anyone else that needs help with the issue this was the expression that worked.

 

Senior Blank = SWITCH(SELECTEDVALUE(Master[Location]),"YYC", IF(ISFILTERED(Master[SR Manager]),1,0),"YUL",IF(ISFILTERED(Master[SR Manager]),1,0),"YMX", IF(ISFILTERED(Master[SR Manager]),1,0),"YYZR", IF(ISFILTERED(Master[SR Manager]),1,0), if(ISFILTERED(Master[Location]),1,0))
hmahesh94
Helper I
Helper I

Hi @JileMeyn 

 

Please try using this in place of your selectedvalue :

CONCATENATEX (
    VALUES ( Master[Location] ),
    ", "
)

What this does is, it picks all the values selected in the Location slicer and concatenates them.

 

If you think this helped, please give a kudos and Mark it as a solution if it worked. 
Let me know if you need help 🙂

 

Cheers,

Mahesh

 

How does that work to only select those 4 locations? It gives me an error when I try and add more then one.

 

Senior Blank = SWITCH(CONCATENATEX(VALUES(Master[Location]), "YYC","YUL", IF(ISFILTERED(Master[SR Manager]),1,0), if(ISFILTERED(Master[Location]),1,0)))

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

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.