Forum Discussion
Anonymous
4 years agoNot applicable
How do I avoid to count the empty value?
Hi,
I want to count how many types in the table below:
Name | Type |
| A | 1 |
| B | 2 |
| C | 2 |
| D | 1 |
| E |
I used the code following:
Type(#) = IF(ISBLANK(DistinctCount(Sheet1[Type])),0,DISTINCTCOUNT(Sheet1[Type]))
The result returned is 3, apprently, it also counts the blank/empty space as a new type.
I am wondering how should I avoid count the blank and got the result is 2?
Thanks!
Hi, Anonymous
There is a function called DISTINCTCOUNTNOBLANK which avoid count blank value.
So to count of Type, just write a measure DISTINCTCOUNTNOBLANK( Table[Type] )
Hope it will work for you.
- Anonymous4 years ago
Thank you!
2 Replies
- ddplSolution Sage
Hi, Anonymous
There is a function called DISTINCTCOUNTNOBLANK which avoid count blank value.
So to count of Type, just write a measure DISTINCTCOUNTNOBLANK( Table[Type] )
Hope it will work for you.
- AnonymousNot applicable
Thank you!