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

Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.

Reply
Anonymous
Not applicable

How to write Dax condition when selected slicer (multiple selection) is equal values in column

Hi experts,

I need advise and help in Dax writing.

 

Here are the scenario, I have a Slicer with settings multiple selection and value {"A", "B", "C", "D" & "E"}. Next I have a table with column value {"A", "B" & "C"}. Since is multiple selection in slicer means I will have different combination happen for example: selected value is "A", "B" / "B", "C", "E"/ etc.

Since "SELECTEDVALUE" Dax is only able return a value and I found this Dax function [CONCATENATEX(VALUES(Table[Column]),[Column],",")] also will return a value by adding "," between values selected.

 

How can I write Dax condition when selected value is exist in my table column? Below are all scenarios I wish to achieve:
1. "A" & "B" is selected and these value is exist in table column, then return "YES".

2. "D" & "E" is selected and these value is not exist in table column, then retun "NO".
3. "A", "C" & "E" is selected and "E" is not exist in table column, although "A" & "C" is matched, still return "NO"

 

My current method is to get all combination will occured by using this Dax function [CONCATENATEX(VALUES(Table[Column]),[Column],",")] to proceed for my Conditional function, however this seems like very hardcoding and is not best practice.
Sample of my current Dax IF(CONCATENATEX(VALUES(Table[Column]),[Column],",") IN {"A","B","C","A,B","A,C","B,C","A,B,C"}, "YES", "NO).

Kindly advice how the Dax function should write to achieve the same features. Thanks in advance.

 

Best Regards,

Yit Chuen

1 ACCEPTED SOLUTION
amitchandak
Super User
Super User

@Anonymous , Try mesure like

 


measure =
var _cnt = countx(allselected(Slicer), slicer[value])
return
if( calculate(distinctCOUNT(Table[column]), filter(Table, Table[column] in values(slicer[value]))) >=__cnt, "Yes", "No")

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

View solution in original post

1 REPLY 1
amitchandak
Super User
Super User

@Anonymous , Try mesure like

 


measure =
var _cnt = countx(allselected(Slicer), slicer[value])
return
if( calculate(distinctCOUNT(Table[column]), filter(Table, Table[column] in values(slicer[value]))) >=__cnt, "Yes", "No")

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

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!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

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