Home » Replace null and empty values with ‘0’ in Tableau

# Replace null and empty values with ‘0’ in Tableau

Tags:

In this blog post we discover how you can replace empty fields in tables with a zero. As you will see below, this is very straightforward.

You can see in this table that some values are empty, that is because there is no corresponding value if that metric for a specific row. For example, when you have null values in your dataset.

You can clean this up by properly displaying ‘0’ values for each of the metrics that have empty values.

Doing this is fairly easy. If you have the following expression…

SUM([n_form_completions])

… you can easily replace empty values with a zero by wrapping the expression in the ZN function.

ZN(SUM([n_form_completions]))

That is how you replace empty values with a zero in Tableau.

### Say thanks, ask questions or give feedback

Technologies get updated, syntax changes and honestly… I make mistakes too. If something is incorrect, incomplete or doesn’t work, let me know in the comments below and help thousands of visitors.