Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
Anonymous
Not applicable

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?

 

2019-03-26_11h31_30.png

2019-03-26_11h24_18.png

1 ACCEPTED SOLUTION
v-juanli-msft
Community Support
Community 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()))

7.png

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.

View solution in original post

1 REPLY 1
v-juanli-msft
Community Support
Community 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()))

7.png

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.

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.