How to Count Null Values in Tableau

Cody Schneider9 min read

While a Tableau visualization might look clean on the surface, lurking beneath are often null values - empty cells where data should be. Spotting them is one thing, but counting them is the critical next step to understanding the health of your dataset. This guide will walk you through several practical methods for counting null values in Tableau, from simple aggregations to powerful calculated fields, helping you move from spotting data gaps to quantifying them.

GraphedGraphed

Still Building Reports Manually?

Watch how growth teams are getting answers in seconds — not days.

Watch Graphed demo video

Why Bother Counting Nulls in the First Place?

Ignoring nulls is like building a house on a shaky foundation. Before we get into the "how," let’s quickly cover the "why." Understanding the volume of missing data is a fundamental part of responsible data analysis for a few key reasons:

  • Data Integrity: High counts of null values can dramatically skew your calculations. Measures like AVG(), SUM(), and COUNT() often ignore nulls by default, which can lead to misleading results. An average sales price calculated from a dataset with thousands of missing price points isn't really the average at all.
  • Analysis Accuracy: If a significant percentage of your data is missing for a key field, any conclusions you draw from it might be inaccurate or unrepresentative. Counting nulls helps you assess how confident you can be in your findings.
  • Data Cleaning: A large number of nulls in a specific column is often a symptom of a deeper problem. It can signal issues with your data entry process, errors in a data pipeline (ETL), or problems with how an application stores information. Counting them helps you identify and ultimately fix the source of the problem.

In short, counting nulls is less about the numbers themselves and more about what they represent: the reliability and completeness of your data.

Method 1: The Quick Drag-and-Drop Check

For a fast, high-level overview of where nulls exist, you don't need any complex formulas. Tableau's default behavior can quickly show you a breakout of values, including the pesky nulls.

Using a Simple Text Table

This is the most straightforward visual check you can perform. It's perfect for quickly eyeballing a dimension and seeing how many records fall into the "Null" category.

Here’s how to do it step-by-step:

  1. Drag the dimension you want to inspect (e.g., [Region] or [Customer Segment]) onto the Rows shelf. Tableau will immediately list all the unique values in that column. If there are nulls, Tableau will create a row labeled “Null.”
  2. Next, drag a measure like Number of Records (or the count of any field) onto the Text mark on the Marks Card.

You’ll instantly get a text table that looks something like this:

[Region]  [Number of Records] North       4,321 South       3,789 East        5,102 West        4,955 Null        650

Right there, you can see that you have 650 records with a null value in the [Region] field. This method is incredibly fast and intuitive, making it a great first step in any data audit.

GraphedGraphed

Still Building Reports Manually?

Watch how growth teams are getting answers in seconds — not days.

Watch Graphed demo video

What if the "Null" indicator is hidden?

Sometimes, mostly with measures dropped onto the view, Tableau will show you an “X nulls” indicator in the bottom-right corner of the view rather than a row in your table. Clicking on this indicator gives you options to either filter the nulls out or show the data at the default position. While helpful, it doesn't integrate the null count directly into your visualization for reporting purposes. For that, we need a more robust solution: calculated fields.

Method 2: Using Calculated Fields for Ultimate Control

Calculated fields are the workhorse of Tableau, and they provide a flexible, reusable, and powerful way to count and analyze null values. Once created, you can use these fields in KPIs, bar charts, filters, and more.

The Go-To Function: ISNULL()

The ISNULL() function is your best friend here. It’s a simple Boolean function that tests a field and returns TRUE if the value is null and FALSE if it's not. We can use this simple test to build some very useful calculations.

Calculated Field 1: A Null Value Counter

This formula creates a new field that assigns a '1' to every row containing a null and a '0' to every row that doesn't. You can then sum this field to get your total null count.

  1. Navigate to Analysis > Create Calculated Field...
  2. Name your calculated field something intuitive, like “[Your Field] Null Count”.
  3. Enter the following formula:
IF ISNULL([Your Field Name]) THEN 1 ELSE 0 END

(Remember to replace [Your Field Name] with the actual field you're checking, like [Order Date] or [Shipping Address].)

After creating this, you can drag this new measure onto the Text mark or into a KPI card. Just make sure the aggregation is set to SUM(). The resulting number will be the total count of null values in that specific field.

This approach is powerful because it’s a row-level calculation. This means it evaluates every single row in your data source, giving you amazing flexibility to aggregate the results later at different levels of detail (e.g., show null counts by region, by month, etc.).

Calculated Field 2: A Direct Aggregate Calculation

If you just need a single KPI number and don’t need the flexibility of a row-level calculation, you can wrap the entire calculation in a SUM() aggregation right in the formula editor.

SUM(IF ISNULL([Your Field Name]) THEN 1 ELSE 0 END)

This creates an aggregate measure that, when dragged into the view, will immediately show the total count of nulls without needing to specify the aggregation on the pill itself.

GraphedGraphed

Still Building Reports Manually?

Watch how growth teams are getting answers in seconds — not days.

Watch Graphed demo video

Visualizing Your Null Counts to Tell a Story

Once you have a calculated field that counts your nulls, you can go beyond just displaying a number. Visualizing the proportion of nulls versus non-nulls is far more impactful for an audience.

Creating a "Null vs. Not Null" Bar Chart

A simple bar chart is often the most effective way to show the scale of your missing data problem. This requires one simple setup calculation.

  1. Create a new calculated field and name it something like "Data Status".
  2. Enter this formula:
IF ISNULL([Your Field Name]) THEN "Null" ELSE "Not Null" END
  1. Drag this new "Data Status" dimension to the Columns shelf.
  2. Drag Number of Records to the Rows shelf.

Almost instantly, you will see a two-bar chart comparing the total count of null records against the count of non-null records. This simple visualization makes it immediately obvious if you have a 1% null issue or a 50% null issue - a distinction that is much harder to grasp from a plain number.

Building a Data Quality Dashboard

For ongoing projects, consider dedicating a specific dashboard to data quality. You can create multiple KPI cards using the null counting calculated fields we discussed:

  • Total Null [Region] Values
  • Total Null [Email Address] Values
  • Total Null [Order Date] Values

Putting these KPIs at the top of a dashboard gives you and your team a real-time health check on your dataset. When a number suddenly spikes, you know you have a data pipeline or entry problem that needs immediate attention.

Practical Tips and Troubleshooting

Real-world data is messy. Sometimes what looks like an empty cell isn't a true Null. Here are a few common gotchas and how to handle them.

Tip 1: Handling Empty Strings ("")

Sometimes, a field doesn't contain a Null but rather an empty string (""). ISNULL() will return FALSE for these, so your count would be inaccurate. To count both true Nulls and empty strings, you can modify your calculated field:

IF ISNULL([Your String Field]) OR [Your String Field] = "" THEN 1 ELSE 0 END

For more robust checking, you can even account for strings that only contain spaces by using the TRIM() function:

IF ISNULL([Your String Field]) OR TRIM([Your String Field]) = "" THEN 1 ELSE 0 END
GraphedGraphed

Still Building Reports Manually?

Watch how growth teams are getting answers in seconds — not days.

Watch Graphed demo video

Tip 2: Working with Zeros (0)

For numeric fields, you might want to treat zeros as if they were nulls. The ZN() function is perfect for this. It takes a measure and returns the value if it's not null, or a 0 if it is null. You can combine this with your logic:

SUM(IF ZN([Your Measure]) = 0 THEN 1 ELSE 0 END)

This is an important distinction: The formula above will count all rows that were originally zero AND all rows that were originally Null, because the ZN() function converts the nulls to zero before the = comparison happens. Be very clear about what you are intending to count when using this method.

Tip 3: The Difference Between COUNT vs. COUNTD

When you're trying to validate your null counts against your non-nulls, remember:

  • COUNT([Your Field]) returns the total number of non-null rows.
  • COUNTD([Your Field]) returns the total number of distinct or unique non-null values.

If you're counting null shipping addresses, you might have 5,000 non-null records (COUNT) but only 3,200 unique addresses (COUNTD). Always be sure which count you're using for your comparisons.

Final Thoughts

Counting nulls is a fundamental skill for anyone serious about creating accurate and reliable Tableau dashboards. By moving beyond just spotting empty cells and using calculated fields with ISNULL(), you can quantify data quality issues, create powerful monitoring tools, and build a solid foundation of trust in your analysis.

Of course, checking for nulls is often just step one of a much larger data-wrangling process. The real challenge for many teams begins before Tableau is even open - just connecting and centralizing data from platforms like Google Analytics, Salesforce, Shopify, and various ad managers can consume hours. We built Graphed to solve this very problem. We make it easy to plug in all your scattered marketing and sales data sources, allowing you to ask questions and build dashboards with simple, natural language. This means you can spot data quality gaps across your entire business and build mission-critical reports in minutes, not days.

Related Articles

How to Enable Data Analysis in Excel

Enable Excel's hidden data analysis tools with our step-by-step guide. Uncover trends, make forecasts, and turn raw numbers into actionable insights today!