Power BI is turning 10! Tune in for a special live episode on July 24 with behind-the-scenes stories, product evolution highlights, and a sneak peek at what’s in store for the future.
Save the dateEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.
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
Solved! Go to Solution.
@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")
@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")
Check out the July 2025 Power BI update to learn about new features.
This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.
User | Count |
---|---|
72 | |
70 | |
37 | |
29 | |
26 |
User | Count |
---|---|
91 | |
49 | |
45 | |
38 | |
37 |