Forum Discussion
How to filter a measure by multiple values
Hello, I would like to create a measure that returns the count of the rows of a table. I am able to use CALCULATE with a single value in the filter expression to get the measure to return the correct count of rows that contain that single value in that column. But I want to filter for not just one value, but for a handfull of values. Anyone know how to do this?
Here's a screenshot:
This successfully returns the number of rows with "Open" in the Stage column, but I want to return the number of rows that contain "Open", "Design" and others.
You can use double pipe || as a logical or
=CALCULATE([measure], table[column 1] = 1 || table[column 1] = 2)
Or is a function that takes 2 parameters. Double pipe || is an inline syntax and you can have as many as you need.
9 Replies
- MattAllington
Community Champion
You can use double pipe || as a logical or
=CALCULATE([measure], table[column 1] = 1 || table[column 1] = 2)
- v-alhansNew Member
When I use that formula, I get the error "The expression contains multiple columns, but only a single column ca be used in a True/False expression that is used as a table filter expression".
My measure is: COUNTA('table[Column])
- Kashuo
Helper I
That works, thank you!!
- MattAllington
Community Champion
Or is a function that takes 2 parameters. Double pipe || is an inline syntax and you can have as many as you need.
- AnonymousNot applicable
what does [measure] mean in your example?
- Kashuo
Helper I
Matt gave it, above. I used "Doublepipe" ||