Forum Discussion
Anonymous
4 years agoNot applicable
Measure result based on OR conditions
Hi Community, In the following dataset, I created a measure that counts distinct clients where contact type <> "EM" || val1 <> 'Y'|| val2<>"Y". Measure = CALCULATE ( DISTINCTCOUNT ('Tabl...
- 4 years ago
Hey Anonymous ,
the measure is a little more complex:Measure 2 = var t_not_EM = CALCULATETABLE( VALUES( 'Table'[Client] ) ,'Table'[Contact Type] <> "EM" ) var t_EM = CALCULATETABLE( VALUES( 'Table'[Client] ) ,'Table'[Contact Type] = "EM" ) var notEM = EXCEPT( t_not_EM , t_EM ) var t_VAL1_VAL2 = EXCEPT( CALCULATETABLE( VALUES( 'Table'[Client] ) ,'Table'[Val1] = "N" || 'Table'[Val2] = "N" ) , notEM ) return COUNTROWS( UNION( notEM , t_VAL1_VAL2 ) )
Based on the measure you get this result on a card visual:If you use CONCATENATEX instead of COUNTROWS you will get this on the card visual:
... CONCATENATEX( UNION( notEM , t_VAL1_VAL2 ) , 'Table'[Client] , " | " )The card visual:
Hopefully, this provides what you are looking for.
Regards,
Tom
Samarth_18
Community Champion
4 years agoHi Anonymous ,
The reason why you are getting 9 is you have added OR condition in type and val1,2 so its considering all type which is not EM in the count. Based on condition you are getting correct output so kindly revisit the condition. 🙂
Thanks,
Samarth