Check your eligibility for this 50% exam voucher offer and join us for free live learning sessions to get prepared for Exam DP-700.
Get StartedDon't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.
Hello All,
I try to make a new DAX function in my dataset :
Solved! Go to Solution.
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
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
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.
Proud to be a Super User!
Paul on Linkedin.
Hello,
Did you try using DISTINCTCOUNT instead of COUNTA?
Yes but it's not Ok with true or false values .
Is [CallID] of type Boolean?
Can you please share your sample data please?
Nope, I need number of disctinct call ID when Rona answered is TRUE or FALSE
Then it should work, as you are trying to apply Count operation on CallID which is a non- boolean column, it won't have any issue.
See a small example I have done:
Two measures I created:
Count with COUNTA = CALCULATE(COUNTA('Table'[CallID]), FILTER('Table','Table'[Roma Answered]= TRUE()))
Outcome- 5
Count with DistinctCount = CALCULATE(DISTINCTCOUNT('Table'[CallID]),FILTER('Table','Table'[Roma Answered] = TRUE()))
Outcome-4
You can further do the required customizations
Thanks for your help, I try to add my other values like in bellow but it doent"s work
I think I can make to calculate with boolean values in powerBI, always one issue message .
User | Count |
---|---|
116 | |
73 | |
60 | |
48 | |
48 |
User | Count |
---|---|
171 | |
122 | |
60 | |
59 | |
56 |