Tableau ZN() Function – Zero Null (Complete Guide)

When working with data in Tableau, one of the most common problems developers and analysts face is handling missing or empty values. These missing values, known as NULL values, can cause serious issues in calculations and visualizations.

For example, your charts may show gaps, your averages may become incorrect, and your reports may look incomplete.

To solve this problem, Tableau provides a very useful function called ZN(). This function converts NULL values to 0 so your calculations and dashboards work correctly.

Tableau provides this function specifically for handling numeric data, making it easier to clean and prepare data for analysis.

In Tableau datasets, many fields contain NULL values. These nulls can cause issues in Tableau calculations; for example, the average calculation may return incorrect values, or line charts may show inconsistent lines where data is missing.

To handle such data sets with null values, Tableau has the ZN() function, which replaces any null value with zero (0).

In this Tableau tutorial, I will explain the use case for the ZN function. We will also review its syntax, then discuss a few examples using sales and profit data.