Forum Discussion
Vanessa250919
5 years agoHelper V
Count Disctint in DAX boolean values
Hello All,
I try to make a new DAX function in my dataset :
# Answered Queue + Rona =
CALCULATE (
COUNTA ( 'FACT Interaction Segment'[Call ID] ),
'FACT Interaction Segment'[Rona Answered] = TRUE ()
)
+ CALCULATE (
COUNTA ( 'FACT Interaction Segment'[Call ID] ),
'FACT Interaction Segment'[Queue Answered] = TRUE ()
)
But I need a Distinct count return for [Call ID], is it possible ?
Thanks
- Anonymous5 years ago
Hi Vanessa250919 ,
It's ok to count boolean values. Try this measure.
Measure = CALCULATE(DISTINCTCOUNT('Table'[id]),FILTER(ALL('Table'),'Table'[boolean]=TRUE()))In your formula you have missed the ")" after "true())".
Best Regards,
Jay
9 Replies
- AnonymousNot applicable
Hi Vanessa250919 ,
It's ok to count boolean values. Try this measure.
Measure = CALCULATE(DISTINCTCOUNT('Table'[id]),FILTER(ALL('Table'),'Table'[boolean]=TRUE()))In your formula you have missed the ")" after "true())".
Best Regards,
Jay
- PC2790Community Champion
Hello,
Did you try using DISTINCTCOUNT instead of COUNTA?
- Vanessa250919Helper V
Yes but it's not Ok with true or false values .
- PC2790Community Champion
Is [CallID] of type Boolean?
Can you please share your sample data please?
- PaulDBrownCommunity Champion
One way is to convert the boolean value to an integer:
INT(TRUE()) returns a value of 1 If true or blank if false. So use this expression in measure (instead of TRUE()) and then you can simply sum the values.