Forum Discussion
DISTINCTCOUNTNOBLANK Function
From the documentation, DISTINCTCOUNTNOBLANK Function, this function is supposed to take a column as a parameter. However, upon trying to use this function, it cannot recognize my column. (Red underline in the DAX formula bar)
For context, I was trying to create a new measure that will show the number of distinct values of letters excluding blanks. Also, the result seems to be wrong. Based on my data, it is supposed to return 3 (A, B, C) but the measure returns 4.
Are these bugs? Or am I just using the function wrong?
Hi Anonymous
As tested, when use this function in a measure, it's result seems incorrect.
As a workaround, create a measure as below
Measure 2 = CALCULATE(DISTINCTCOUNT(Table1[letter]),FILTER(ALL(Table1),Table1[letter]<>BLANK()))
Best Regards
Maggie
Community Support Team _ Maggie Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
1 Reply
- v-juanli-msftCommunity Support
Hi Anonymous
As tested, when use this function in a measure, it's result seems incorrect.
As a workaround, create a measure as below
Measure 2 = CALCULATE(DISTINCTCOUNT(Table1[letter]),FILTER(ALL(Table1),Table1[letter]<>BLANK()))
Best Regards
Maggie
Community Support Team _ Maggie Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.