Count the number of occurrences of Null in a column in tableau

Dan picture Dan · Jun 7, 2016 · Viewed 21.1k times · Source

I am relatively new to Tableau and I am wondering if there is a way to calculate null values in a column. I have a column called Email of type string and want to know how many people have not entered their email i.e. Null.

I tried to create a calculated field with count(ISNULL([Email]))

But this gives me the total count and not the count of null.

Thanks.

Answer

Nick picture Nick · Jun 7, 2016

You cannot count NULL since COUNT ignores NULLs.

You can do this, though:

SUM(IF ISNULL([Email]) THEN 1 ELSE 0 END)


Per your additional comment, if you wanted to count where two fields are both NULL then:

SUM(IF ISNULL([Email]) AND ISNULL([Phone]) THEN 1 ELSE 0 END)

You can continue this for any number of fields, as needed.