Forum Discussion
How to use filter with multiple values in DAX?
- 9 years agoMy fault you have to use curly braces {...} instead of (...)
Regards
Hey,
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
Hello Anonymous,
thanks for your response.
unfortunatly the given ideas dont work :(
please check the image below
- TomMartens9 years agoSuper UserMy fault you have to use curly braces {...} instead of (...)
Regards- nilimarodrigues6 years agoHelper III
Solved my problem :). Thank you!
- info_algoritmia3 years agoHelper II
Hey, thanks for this, what if you want to do the opposite, you need to select values you DONT want in your results, how would that look like? thanks!