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 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
Does that mean if I enter data manually in PBI Desktop, blank cells are rendered as white spaces, which I will have to replace to null?
- parry2k7 years ago
Super User
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.
- Nathaniel_C7 years ago
Community Champion
Hi chandakaushik ,
You may want to ask KenPuls . He wrote an amazing book about Power Query. M Is for (Data) Monkey.
- KenPuls7 years ago
Helper II
So... personally I usually pull data from external data sources. This is one of those areas that is kind of frustrating, as PowerBI seems to read those empty cells and places blanks instead of null values. The only way I know of to fix this is to replace <nothing> with null on the column to correct the default behaviour.