How to Use ISNULL in Tableau

Cody Schneider8 min read

Dealing with gaps in your data is a universal challenge, but in Tableau, it doesn't have to be a headache. NULL values, the symbols for missing or unknown data, can trip up your calculations and skew your visualizations if left unchecked. This article will show you how to master the simple yet powerful ISNULL() function to find, manage, and transform these empty values, giving you cleaner data and more accurate dashboards.

What Exactly Is a NULL Value?

Before jumping into the solution, it's helpful to understand what a NULL value really represents. A NULL isn't the same as a zero (0) or a blank space (" "). A zero is a specific numerical value, and a blank space is a specific text character. A NULL, on the other hand, means there is simply no value present.

Think of it like filling out a form. If a question for "Middle Name" is left blank, the response is NULL. It doesn't mean the person's middle name is 'Zero' or an empty P.O box - it just means the information isn't there.

In data analysis, this distinction is important. Tableau often treats NULLs differently in calculations:

  • Aggregations: Functions like SUM(), AVG(), or COUNT() typically ignore NULLs. If you calculate the average sales across 10 rows and one row has a NULL value for sales, Tableau will calculate the average of the other nine rows. This can be misleading if you're not aware of it.
  • Formulas: Any mathematical operation involving a NULL, such as [Sales] + NULL, will result in NULL.
  • Visualizations: Sometimes, NULLs appear as gaps in line charts or are grouped into an "unknown" category, which may not be ideal for your final report.

Handling these NULLs is the first step toward building trustworthy and professional-looking dashboards. That's where the ISNULL() function comes in.

Your Go-To Solution: The ISNULL() Function

The ISNULL() function is one of the most fundamental tools in your Tableau toolkit. It’s a logical function that checks whether a given field contains a NULL value and gives you a straight answer: TRUE or FALSE.

The syntax couldn't be simpler:

ISNULL([Field Name])

For every row in your data, this function will look at the specified [Field Name]:

  • If the value is NULL, the function returns TRUE.
  • If the value is anything else (a number, a date, a string), the function returns FALSE.

This simple TRUE/FALSE output is a powerful building block for cleaning data, creating filters, and making your calculations more robust.

Putting It to Work: Creating a Calculated Field with ISNULL()

The most common way to use ISNULL() is within a calculated field. Let's walk through the steps. Imagine we have a dataset of customer orders, but the [Shipping Date] field is sometimes empty.

Our goal is to create a new field that flags these unshipped orders.

  1. In your Tableau worksheet, navigate to the Data pane on the left-hand side.
  2. Click the small downward-facing arrow at the top right of the pane (next to the search bar) and select "Create Calculated Field."
  3. A calculation editor will pop up. First, give your new field a descriptive name. Let's call it "Is Shipping Date Missing?".
  4. In the formula box, type the following expression:

ISNULL([Shipping Date])

  1. You'll see a message below the box that says, "The calculation is valid." Click OK.

That's it! You've successfully created a new field in your data source. If you drag this new field into your view (for example, onto the "Rows" shelf next to the [Order ID]), you'll see a list of "True" and "False" values, clearly identifying every order that's still waiting to be shipped.

Common Scenarios for Using ISNULL() in Tableau

Now that you know how to create a basic ISNULL() calculation, let's explore some practical, real-world examples of how you can use it to improve your dashboards.

Use Case #1: Counting How Many Values Are Missing

First, you might want to understand the scale of your missing data problem. How many orders actually have a NULL shipping date? We can combine ISNULL() with an IF statement to count them.

Create a new calculated field called "Missing Shipping Date Count" with this formula:

IF ISNULL([Shipping Date]) THEN 1 ELSE 0 END

This formula checks each row. If [Shipping Date] is NULL, it assigns a 1, otherwise, it assigns a 0. Now, you can drag this new calculated field onto a KPI card and apply a SUM() aggregation to it. The result will be a total count of all your missing shipping dates.

Use Case #2: Replacing NULLs with Meaningful Text or Numbers

Showing "NULL" in a table or on an axis label doesn't look very professional. It's often better to replace these empty values with something more descriptive. This is where combining ISNULL() with the IF THEN ELSE logic truly shines.

Example 1: Replacing NULL Text Fields

Let's say your sales data has a [Region] field, but some sales aren't assigned to a region yet. We can replace these NULLs with "Uncategorized."

Create a calculated field named "Region (Cleaned)":

IF ISNULL([Region]) THEN "Uncategorized" ELSE [Region] END

Now, whenever you use the "Region (Cleaned)" field in a chart or a table, you'll see "Uncategorized" instead of NULLs.

Example 2: Replacing NULL Numerical Fields

Similarly, imagine an online store transaction dataset where the [Discount Applied] field is NULL if no discount was used. A NULL can cause issues in calculations like SUM(Discount Applied). Let's replace those NULLs with zero.

Create a calculated field named "Discount (Cleaned)":

IF ISNULL([Discount Applied]) THEN 0 ELSE [Discount Applied] END

By using this cleaned field in your calculations, you ensure that every row has a valid numerical value, making your totals accurate.

Use Case #3: Filtering Your View to Show or Hide Records with NULLs

Sometimes you need to focus your analysis only on a complete set of data. Other times, you want to isolate the problematic rows to investigate them. ISNULL() makes filtering easy.

Let’s go back to our first calculated field, "Is Shipping Date Missing?", which returns TRUE or FALSE.

  1. Drag the "Is Shipping Date Missing?" field from the Data pane directly onto the Filters shelf.
  2. A dialog box will appear, asking you to choose which values to filter by: True or False.
  3. To exclude all rows with missing shipping dates, check the box next to "False" and click OK. Your viz will now only show completed orders.
  4. To see only the records with missing shipping dates, check the box next to "True" and click OK. This creates a handy data quality report you can use to identify issues.

Use Case #4: Creating Dynamic Groups from NULL and Non-NULL Values

You can also use ISNULL() to segment your data into useful categories for analysis. For example, maybe you want to compare the average order value between customers who have provided a [Date of Birth] and those who haven't.

Create a calculated field called "Customer Segment" to group them:

IF ISNULL([Date of Birth]) THEN "Contact Info Incomplete" ELSE "Contact Info Complete" END

Now, you can use this [Customer Segment] field in your visualization. Drag [Customer Segment] to the Columns shelf and AVG([Order Value]) to the Rows shelf to create a bar chart. This instantly reveals if one group behaves differently from the other, potentially unlocking valuable insights about your customer data collection efforts.

A Handy Shortcut: Getting to Know the IFNULL() Function

Now that you're comfortable with the IF ISNULL(...) THEN... pattern for replacing NULLs, it's time to learn a shortcut: the IFNULL() function.

This function does the exact same thing but with a cleaner, more concise syntax. It checks a field and, if it's NULL, returns a replacement value you provide.

Here’s the syntax:

IFNULL([Field to Check], [Value to use if NULL])

Let's revisit our discount example. Instead of writing this:

IF ISNULL([Discount Applied]) THEN 0 ELSE [Discount Applied] END

We can simply write this:

IFNULL([Discount Applied], 0)

Both formulas achieve the exact same result. So when should you use each one?

  • Use ISNULL() when your primary goal is to get a TRUE/FALSE answer for more complex logical tests, filtering, or conditional counts.
  • Use IFNULL() as your quick and easy shortcut when you're doing a simple search-and-replace for NULL values.

Final Thoughts

As you can see, ISNULL() is a fundamental tool for data preparation directly within Tableau. By using it to check for, count, replace, and filter based on missing data, you can build far more reliable dashboards and gain confidence in the accuracy of your analysis. Mastering this function and its companion, IFNULL(), moves you from being a user of Tableau to being a true creator of powerful, clean, and insightful data visualizations.

Data cleaning tasks are often the first step in a long reporting process that traditionally takes hours. Even with handy functions like ISNULL(), finding and fixing data issues across platforms is still manual work. In our work, we've found that these tedious steps are precisely what AI can help automate. For instance, with Graphed , you can connect your data sources once and use natural language to ask for exactly what you need. Instead of building calculated fields to handle exceptions, you can describe your goal like "show me total sales grouped by our cleaned region field, replacing any empty regions with 'Uncategorized'," and have a real-time dashboard built for you instantly.

Related Articles

How to Connect Facebook to Google Data Studio: The Complete Guide for 2026

Connecting Facebook Ads to Google Data Studio (now called Looker Studio) has become essential for digital marketers who want to create comprehensive, visually appealing reports that go beyond the basic analytics provided by Facebook's native Ads Manager. If you're struggling with fragmented reporting across multiple platforms or spending too much time manually exporting data, this guide will show you exactly how to streamline your Facebook advertising analytics.

Appsflyer vs Mixpanel​: Complete 2026 Comparison Guide

The difference between AppsFlyer and Mixpanel isn't just about features—it's about understanding two fundamentally different approaches to data that can make or break your growth strategy. One tracks how users find you, the other reveals what they do once they arrive. Most companies need insights from both worlds, but knowing where to start can save you months of implementation headaches and thousands in wasted budget.