Forum Discussion

chandakaushik's avatar
7 years ago
Solved

COUNTA function is counting blank cells as well

Did anyone notice that COUNTA DAX function is counting blank cells in the column as well? Microsoft's documentation says it counts the number of cells in a column that are not empty. Any idea what's happening? The column I am counting has text data type.

  • parry2k's avatar
    parry2k
    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.

10 Replies

  • 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

    • chandakaushik's avatar
      chandakaushik
      Icon for Helper I rankHelper I

      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_C's avatar
        Nathaniel_C
        Icon for Community Champion rankCommunity Champion

        chandakaushik parry2k ,

         

        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