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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

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
July PBI25 Carousel

Power BI Monthly Update - July 2025

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

Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 community update carousel

Fabric Community Update - June 2025

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