Forum Discussion
Anonymous
9 years agoNot applicable
Distinct count rows that are not blank!
Hey everyone, How can I count all the distinct values in a column except the blank(null) values? I tried several things but nothing works.
- Anonymous9 years ago
=calculate( distinctcount(MyTable[MyColumn]), MyTable[MyColumn] <> BLANK())
Anonymous
9 years agoNot applicable
Hey Anonymous
If the distinctcount of a column is equal to zero then distinctcount returns BLANK(null). Can I fix this to show 0 instead of null?
Oxenskiold
9 years agoAdvocate I
Hi Anonymous,
you can use this:
=
CALCULATE ( DISTINCTCOUNT ( MyTable[MyColumn] ), MyTable[MyColumn] <> BLANK () ) + 0
<Blank> + 0 equals 0
Kind regards
Oxenskiold
- Anonymous9 years agoNot applicable
Thanks Oxenskiold! :))