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())
jklemetsrud
4 years agoNew Member
Doesn't look like this has been updated in a while. While the solution does in fact work, you now have the option of DISTINCTCOUNTNOBLANK
ie.
DIAD Count =
VAR _TheCount = CALCULATE
(
DISTINCTCOUNTNOBLANK('Equity Accounts'[DAID])
)
RETURN
IF(ISBLANK(_TheCount),0,_TheCount)
Just thought I'd share for anyone searching out there.