How to Exclude Null in Tableau

Cody Schneider8 min read

Seeing "Null" values cluttering up your Tableau dashboard can be frustrating, especially when you need a clean, clear visualization for your report. These empty data points can throw off your calculations and make charts harder to read. This guide will walk you through several straightforward methods to exclude null values, so you can present your data accurately and professionally.

GraphedGraphed

Still Building Reports Manually?

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

Watch Graphed demo video

What Are Null Values Anyway?

In data analysis, "Null" simply means a value is missing or unknown. It’s not the same as zero or a blank space, it’s the absence of a value altogether. They often appear in your data for a few common reasons:

  • Incomplete Data Entry: A form field was left blank when the data was originally collected.
  • Join Mismatches: When you join two data tables, a row in one table might not have a corresponding match in the other.
  • Optional Fields: The data point might be optional, like a "Discount Code" field that doesn't apply to every order.
  • Data Extraction Errors: Sometimes, issues during data transfer or processing can result in nulls.

While nulls are a normal part of working with data, they can cause problems in Tableau. They might skew averages, create misleading totals, or simply add unnecessary visual noise to your charts and tables. Filtering them out is a fundamental skill for creating reliable reports.

Method 1: The Quick Filter (Easiest Method)

The simplest way to remove nulls is by using Tableau’s built-in filter functionality. This approach is perfect for a one-off analysis on a single worksheet where you just need to hide the missing values quickly.

Let's say you have a bar chart showing sales by product category, but one bar is labeled "Null" because some sales records are missing a category assignment. Here's how to hide it:

Step-by-Step Instructions

  1. Find the field (dimension or measure) that contains the null values in your Data pane. In our example, this would be "Product Category".
  2. Drag that field onto the Filters shelf.
  3. A dialog box will pop up, listing all the values present in that field, including "Null".
  4. Simply uncheck the box next to Null.
  5. Click OK.

That's it. The "Null" category will disappear from your visualization on that specific worksheet. This is the go-to method for quick, straightforward filtering without adding complexity to your workbook.

GraphedGraphed

Still Building Reports Manually?

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

Watch Graphed demo video

Method 2: Create a Calculated Field for More Control

While the quick filter is great, sometimes you need a more flexible or reusable solution. A calculated field gives you a powerful way to define what you want to keep or exclude. This method is especially useful when your filtering logic is more complex or when you want to use the same filter across multiple worksheets.

We'll use the ISNULL() function, which checks if a value is null and returns a Boolean result (True or False).

Step 1: Create the "Is Null" Check

First, we need to create a simple calculation that identifies the nulls.

  1. Go to the top menu and select Analysis > Create Calculated Field.
  2. Name your calculated field something intuitive, like "Is Category Null?".
  3. In the formula box, enter the following expression, replacing [Product Category] with your actual field name:
ISNULL([Product Category])
  1. This formula will look at each row. If [Product Category] is null, it returns True. If it has a value, it returns False.
  2. Click OK.

Step 2: Use the Calculation as a Filter

Now you have a brand-new field in your Data pane that acts as a flag for null values.

  1. Drag your new calculated field ("Is Category Null?") onto the Filters shelf.
  2. A filter dialog box will appear again, this time asking you to choose between "True" and "False".
  3. Since you want to exclude the nulls (where the calculation is True), you should select "False".
  4. Click OK.

Your view will now only show the data where the Product Category is not null. You can reuse this same calculated field on any other worksheet in your workbook.

Alternatively, you could use the formula NOT ISNULL([Product Category]). With this variation, when you filter, you'd select "True" because you want to keep data where the value is not null.

Method 3: Group Nulls into a Meaningful Category

Sometimes, removing nulls completely isn't the right answer. You might want to keep the data but categorize the nulls to give them more context. For instance, instead of hiding products with missing categories, you could label them as "Uncategorized" or "TBD". This keeps your sales figures complete while still cleaning up the view.

GraphedGraphed

Still Building Reports Manually?

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

Watch Graphed demo video

Step-by-Step Instructions

  1. In the Data pane, find the dimension containing the null values. In our case, "Product Category".
  2. Right-click on the dimension and select Create > Group.
  3. In the "Create Group" dialog box, you'll see a list of all your product categories. You should also see a "Null" value in the list.
  4. Select the Null value and click the Group button. Tableau will create a new group containing only the null values.
  5. You can rename this new group to something more descriptive. Click "Rename" and change it to "Uncategorized" or "Unknown."
  6. Click OK.

Tableau will create a new grouped field in your Data pane (e.g., "Product Category (group)"). Use this new field in your worksheet instead of the original "Product Category" field. Now, your chart will show a bar for "Uncategorized" instead of the ambiguous "Null". This method gives you the best of both worlds: a clean legend and complete data.

Method 4: Use a Data Source Filter for Workbook-Wide Exclusion

If you're absolutely certain you want to exclude null values from a specific field across your entire Tableau workbook, a data source filter is the most efficient option. This type of filter removes the data before it even enters your worksheets, ensuring consistency everywhere.

Warning: Apply this with care. Once you set a data source filter, you won't be able to access the excluded data in any part of your workbook unless you remove the filter.

Step-by-Step Instructions

  1. Go to the Data Source tab in the bottom-left corner of your Tableau workspace.
  2. In the upper-right corner of the screen, you'll see a "Filters" section. Click Add.
  3. An "Add Filter" dialog will appear. Click Add again to choose a field.
  4. Select the field from which you want to remove nulls (e.g., "Product Category").
  5. The familiar filter dialog box will pop up. Just as before, you can either select all values except "Null" or go to the "Exclude" tab and select "Null".
  6. Click OK twice to close the windows.

Now, any new worksheet you create using this data source will automatically have the null values from that specific field already stripped out. This is a great way to enforce data standards and reduce repetitive filtering work for analysts using the workbook.

GraphedGraphed

Still Building Reports Manually?

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

Watch Graphed demo video

Handling Nulls in Measures with ZN()

So far, we've focused on dimensions (categorical data). But what about measures (numerical data)? If a [Sales] field is null, it won't show up in your chart, but it also won't be treated as zero when you calculate an average. This can inflate your average value because the nulls are simply ignored in the calculation.

To fix this, Tableau has a simple function: ZN(). It stands for "Zero Null" and does precisely that - it replaces any null value with a zero.

To use it, create a new calculated field:

  1. Give it a name like "Sales (clean)".
  2. Enter the formula:
ZN([Sales])
  1. Click OK.

Now, use this new "Sales (clean)" measure in your visualizations. When Tableau calculates aggregates like averages or totals, it will treat the previous nulls as zeros, giving you a more accurate representation of your data.

Choosing the Right Method for Your Goal

With several options available, here’s a quick guide to help you pick the right one:

  • Use a Quick Filter when... you're doing a quick, exploratory analysis for a single chart and want the fastest solution.
  • Use a Calculated Field when... you need a reusable filter, want to build more complex logical conditions, or need to share the filtering logic easily with others.
  • Use Grouping when... you need to keep the data associated with nulls but want to classify them under a more meaningful label.
  • Use a Data Source Filter when... you are certain that you always want to exclude these nulls for the entire workbook and all users.
  • Use ZN() when... you're working with numerical data (measures) and need to convert nulls to zeros for accurate calculations.

Final Thoughts

Dealing with null values is an everyday task in Tableau, and knowing how to handle them effectively is a core skill for any data analyst. By choosing the right method - from a simple filter drag-and-drop to a flexible calculated field - you can ensure your dashboards are clean, accurate, and easy for your audience to understand.

We know that prepping and cleaning data is often the most time-consuming part of a data person's job. Manually filtering nulls, creating calculations, and setting up dashboards in complex BI tools takes hours. We built Graphed to automate that entire process. Just connect your data sources, and you can ask for exactly what you need in plain English. Instead of clicking through filter menus, simply say, "Show me last month's conversion rate by campaign, and exclude any traffic from unknown sources." Graphed generates the live-updating dashboard instantly, so you can spend less time cleaning data and more time acting on it.

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!