The ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM.
Get registeredCompete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.
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 |
---|---|
86 | |
84 | |
35 | |
35 | |
34 |
User | Count |
---|---|
94 | |
79 | |
63 | |
55 | |
52 |