Forum Discussion
COUNTA function is counting blank cells as well
- 7 years ago
that's what is looks like, and only reason you need to do that because you are using COUNTA or similar function which doesn't count BLANK otherwise you can always put condition in your measure to check for whitespace and blank() but replace can be more elegant solution.
chandakaushik can you share sample dataset, what you are trying to do and what is not working? If it actually BLANK() or empty value in text field.
here is post on more detail on BLANK
parry2k I entered the data directly in PBI Desktop using "Enter Data" . Here is the sample dataset.
When using COUNTA on address column, it gives me a count of 10 while there are only 6 values in the column. I tried using ISBLANK function on address column, it gives me FALSE for each value.
- Nathaniel_C7 years ago
Community Champion
That is interesting. I am getting the same results, however if I load a table from Excel, the counta function works as expected, or rather Excel does not load anything into a blank cell.
Nathaniel
- parry2k7 years ago
Super User
Seems like when you are entereing data manually, it is not blank but white space. why not open you table in query editor and check if you see null or whitespace
- parry2k7 years ago
Super User
chandakaushik based on your screen shot, it is not blank it has whitespace and that's why counta is not working
here I entered data manually, and how the table looks like and in 2nd image below, I used the replace command to replace whitespace with null and tha'ts when I see null and in this case it will work with BLANK() and 2nd case your COUNTA function will work
- chandakaushik7 years ago
Helper I
, Nathaniel_C - Yes, you're right Nathaniel. This is surprizing me as well. I don't understand how PBI is rendering blank cells in manually created tables.
parry2k - I entered the data manually and I'm sure there are no white spaces in the table. It's not showing null for blank cells in Power Query. When I use ISBLANK(TRIM([Address])), it still returns FALSE.