Forum Discussion
pramita
6 years agoHelper II
Multiple OR
This is my code, I want to find out the number of fewer than 4 ratings an employee has given for specific questions. I would like to know where I'm going wrong. DI JR = DIVIDE(CALCULATE( COUNTR...
- 6 years ago
pramita, instead of "OR", try "||" instead. Good luck.
- 6 years ago
Just like what musicbydannyd suggested, OR can only add two conditions,e.g OR(OR(condition1,condition2),condition3.
However || can add more than 2 conditions, e.g. condition1 || condition2 || condition3 ||....||condition N.
- 6 years ago
pramita , try like
DI JR = DIVIDE(CALCULATE( COUNTROWS('INPUT'),filter('INPUT', 'INPUT'[Level] = "JR", OR( OR( OR( OUTPUT[Q1] < 4, OUTPUT[Q5] < 4 ), OR( OUTPUT[Q7] < 4, OUTPUT[Q8] < 4 ) ), OUTPUT[Q11] < 4) )), DISTINCTCOUNT(OUTPUT[Email Address])) - 6 years ago
Hi pramita
Try below:
DI JR = DIVIDE ( CALCULATE ( COUNTROWS ( INPUT ), VALUES ( 'INPUT'[Level] ) = "JR", FILTER ( OUTPUT, OR ( OR ( OR ( OUTPUT[Q1] < 4, OUTPUT[Q5] < 4 ), OR ( OUTPUT[Q7] < 4, OUTPUT[Q8] < 4 ) ), OUTPUT[Q11] < 4 ) ) ), DISTINCTCOUNT ( OUTPUT[Email Address] ) )Best Regards
Maggie
Community Support Team _ Maggie Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
amitchandak
6 years agoSuper User
pramita , try like
DI JR = DIVIDE(CALCULATE(
COUNTROWS('INPUT'),filter('INPUT',
'INPUT'[Level] = "JR",
OR(
OR(
OR(
OUTPUT[Q1] < 4,
OUTPUT[Q5] < 4
),
OR(
OUTPUT[Q7] < 4,
OUTPUT[Q8] < 4
)
),
OUTPUT[Q11] < 4)
)),
DISTINCTCOUNT(OUTPUT[Email Address]))