Hi Ruth, if you read the definition of the isnontext() function, you will notice that in dax, empty strings are considered as text. the solution is to change, in PQ, the empty value by "null". Thanks :) docs.microsoft.com/en-us/dax/isnontext-function-dax
Hi Ruth, I highlighted this behavior since the function was first announced and I did not received a clear response (you can reveiw the comments on the announcement post). The reason why it work with number and not with text is because for numeric fields blanks are considered as (or implicitely converted to) nulls witch is not the case for text fields, blanks stay blanks (are converted to empty string). Inspect your table using the data profiling tool and you will see that for the text column the count of blank is 0. To be sure that the function work with text fileds you have to replace any blank with null. I think that the description of the function have to be changed or it name have to be DistinctCountNoNull
I'd definitely like to see a video that goes through empty string vs blank vs null in Power BI and the techniques for data prep/replacement. If you're not coming from a development or advanced DB background, you might not have a clear understanding of how data might contain 2-3 variations on "nothing" or "undefined".
As others already pointed out, empty strings are not considered blank. What you can do is convert empty strings to null/blank in PQ editor, or you can write your own "DISTINCTCOUNTNOBLANK" for strings: DistinctLettersNoBlank = CALCULATE ( DISTINCTCOUNT ( Data[Letters] ); NOT ( ISBLANK ( Data[Letters] ) ) && Data[Letters] "" )
Yeah, hoss mentioned that in his comment, it is because I have empties instead of nulls...DAXFridays miss!! But I am sure others will make the same mistake so I will leave the video on. Happy Friday! /Ruth