Forum Discussion
CALCULATE using multiple OR filters
Hello
I CALCULATE the following:
CALCULATE(COUNTROWS(Table1),FILTER(Table1,Table1[source]=SELECTEDVALUE(Table2[system])))
How can I add the following filters in the above calculation please?
Table1[field1]<>"" || Table1[field2]<>"" || Table1[field3]<>""
&&
Table1[field4]<>"Y"
Thanks!
Based on the way you have it stated I think you want to consider it like this:
CALCULATE ( COUNTROWS ( Table1 ), FILTER ( Table1, Table1[source] = SELECTEDVALUE ( Table2[system] ) && ( Table1[field1] <> "" || Table1[field2] <> "" || Table1[field3] <> "" ) && Table1[field4] <> "Y" ) )Grouping the or's on 1 2 and 3 together.
3 Replies
- edhans
Community Champion
This will generally do what you want, but you may need to insert parenthesis to group your and/or operators to get the results you are expecting.
Measure = CALCULATE( COUNTROWS( Table1 ), FILTER( Table1, Table1[source] = SELECTEDVALUE( Table2[system] ) && Table1[field1] <> "" || Table1[field2] <> "" || Table1[field3] <> "" && Table1[field4] <> "Y" ) ) - ryan_mayu
Super User
Anonymous
does this work for you?
CALCULATE(COUNTROWS(Table1),FILTER(Table1,Table1[source]=SELECTEDVALUE(Table2[system] && (Table1[field1]<>"" || Table1[field2]<>"" || Table1[field3]<>""
&&
Table1[field4]<>"Y"))))- jdbuchanan71
Super User
Based on the way you have it stated I think you want to consider it like this:
CALCULATE ( COUNTROWS ( Table1 ), FILTER ( Table1, Table1[source] = SELECTEDVALUE ( Table2[system] ) && ( Table1[field1] <> "" || Table1[field2] <> "" || Table1[field3] <> "" ) && Table1[field4] <> "Y" ) )Grouping the or's on 1 2 and 3 together.