Forum Discussion
Anonymous
9 years agoNot applicable
How to use filter with multiple values in DAX?
Hello guys, I am trying to create a measure TotalExaminationBacklog which counts all the examinationsIDs with the status WAI, VER, APP, HEL and SCH. But it seems that my measure (see image ...
- 9 years agoMy fault you have to use curly braces {...} instead of (...)
Regards
TomMartens
Super User
9 years agoHey,
my current favorite to check if one value is contained in a set of values is using the newer IN() operator
So you can write it like this
COUNTX(
'Yourtable'
,'Yourtable'[YourColumn] IN ("WAI", "VER", "APP","HEL", "SCH")
)
Edited 2017-11-09 (start):
The statement above will not work due a type, the correct statement uses curly braces, why is explained in my last post. The correct statement will look like
COUNTX(
'Yourtable'
,'Yourtable'[YourColumn] IN {"WAI", "VER", "APP","HEL", "SCH"}
)Edited 2017-11-09 (end):
Assuming that the STATUS comes from a slicer, this would also be possible
COUNTX(
'Yourtable'
,'Yourtable'[Yourcolumn] IN (ALLSELECTED('MaybeAnotherTable'[ColumnUsedInSlicer]))
)Maybe this idea helps you give another idea