How to Remove Rows in Tableau Prep

Cody Schneider••8 min read

Getting your data ready for analysis often means removing unnecessary baggage - rows that are incomplete, irrelevant, or just plain wrong. If you're using Tableau Prep, you have a powerful toolkit for tidying up your dataset before it ever gets to a dashboard. This guide will walk you through several practical methods for removing rows in Tableau Prep, from simple clicks to more advanced calculations, helping you build a clean and reliable data source.

GraphedGraphed

Build AI Agents for Marketing

Build virtual employees that run your go to market. Connect your data sources, deploy autonomous agents, and grow your company.

Watch Graphed demo video

Why Bother Removing Rows?

Data cleaning isn't the most glamorous part of data analysis, but it's arguably the most important. Garbage in, garbage out. Removing specific rows ensures your final visualizations and insights are accurate and trustworthy. Here are a few common scenarios where you'll need to filter your data:

  • Removing Incomplete Data: Rows with missing or null values for critical fields can skew your analysis. For example, sales records without a sale amount.
  • Excluding Irrelevant Records: Your dataset might contain test entries, internal user activity, or data outside your specific scope (like sales from a previous year you don't want to include).
  • Filtering Out Duplicates: Sometimes data ingestion processes create duplicate or near-duplicate rows that can inflate your numbers.
  • Handling Outliers: You might need to remove extreme values that are likely errors or that distort the scale of your charts, such as a product priced at $999,999 due to a typo.

Mastering these filtering techniques in Tableau Prep puts you in direct control of your data quality.

Method 1: Direct Selection and Exclusion

The simplest way to remove rows is by directly interacting with the values in your data profile. This method is great for quick, one-off removals when you can see the values you want to get rid of.

Imagine you're looking at a list of U.S. states but see a few outlier entries like "N/A" or "Not Specified."

Step-by-Step Instructions:

  1. Add a Clean Step in your Tableau Prep flow after your input step.
  2. In the Profile pane, click on the field containing the value(s) you want to remove. For our example, this would be the "State" field.
  3. Find the value you want to exclude (e.g., "N/A"). Click on it. If you need to select multiple values, hold down Ctrl (on Windows) or Command (on Mac) while clicking each value.
  4. Once you've selected the values, right-click on one of them. You'll see a contextual menu.
  5. Choose Exclude. Tableau Prep will immediately filter out all rows containing those selected values in that specific field.

You can also use the opposite command, Keep Only, if you'd rather define the small subset of data you want to work with. For example, if you only wanted to see data for California and New York, you could select those two values, right-click, and choose "Keep Only."

When to use this method: When you have a small, fixed number of distinct values to remove and don't expect them to change. It's fast, visual, and requires no code.

Free PDF · the crash course

AI Agents for Marketing Crash Course

Learn how to deploy AI marketing agents across your go-to-market — the best tools, prompts, and workflows to turn your data into autonomous execution without writing code.

Method 2: Using the Filter Values Option

For more complex or dynamic filtering needs, the dedicated "Filter Values" option offers far more control. This allows you to create rules that Tableau Prep will apply every time the flow is run, making it a more robust solution than direct selection.

Step 1: Create a Filter in Your Clean Step

Within any Clear step, you'll see a "Filter Values" button on the toolbar. Clicking this will open up a calculation editor specifically for creating filters.

Alternatively, you can click the ellipsis (...) on any field card and select "Filter." From here, you can choose from several filter types.

Option A: Filter Using a Calculation

This is the most powerful and flexible option. You can write a simple expression that returns true or false, and Tableau Prep will keep the rows where the expression is true.

Example 1: Removing Internal Test Orders

Let's say your sales data includes test orders made by colleagues whose email addresses end in "@yourcompany.com." You want to remove them so they don't inflate your sales numbers.

NOT CONTAINS([Customer Email], "@yourcompany.com")

This formula tells Tableau Prep to check the "Customer Email" field for each row. If the email does not contain "@yourcompany.com," the condition is true, and the row is kept. If it does contain it, the condition is false, and the row is removed.

Example 2: Focusing on High-Value Sales

Perhaps you only want to analyze sales over a certain threshold, say $100.

[Sales] > 100

This simple calculation keeps only the rows where the value in the "Sales" field is greater than 100. Any rows with sales of $100 or less will be removed.

Example 3: Working with Dates

Filter expressions are also great for date ranges. If you only want to see data for the year 2023:

YEAR([Order Date]) = 2023
GraphedGraphed

Build AI Agents for Marketing

Build virtual employees that run your go to market. Connect your data sources, deploy autonomous agents, and grow your company.

Watch Graphed demo video

Option B: Filtering on Null Values

Incomplete data is a common headache. If you have an "Order ID" field, any row where that ID is missing is probably not useful data. You can easily remove these.

  1. Click the ellipsis (...) on the "Order ID" field card.
  2. Select Filter > Null Values.
  3. You'll get a choice to either Keep Null Values or Exclude Null Values.
  4. Choose Exclude Null Values to remove all rows where the Order ID is missing.

Option C: Filtering a Range of Values

This option is useful for numeric data or dates where you want to keep or exclude everything within a specific range.

  1. Click the ellipsis (...) on a numeric or date field card, like "Sales" or "Order Date."
  2. Select Filter > Range of Values.
  3. Tableau Prep will show a visual distribution of your data. You can drag the handles to define the range you want to keep.
  4. Anything outside this range will be filtered out. This is a very intuitive way to remove outliers.

When to use this method: When your filtering logic is based on a rule, calculation, or specific data condition. It is perfect for creating repeatable, dynamic flows that can handle new data you feed it later without requiring manual intervention.

Method 3: Remove Duplicates Using an Aggregate Step

Tableau Prep doesn't have a one-click "remove duplicate rows" button because "duplicate" can mean different things. For example, is an entry a duplicate if every single field is identical, or just if the OrderID is the same? The aggregation step gives you precise control over this.

Imagine your data source accidentally sent you two identical records for every single sale.

Step-by-Step Instructions:

  1. Click the "+" icon next to your Clean step and choose Aggregate.
  2. The Aggregate step view is divided into two parts: Grouped Fields and Aggregated Fields.
  3. Drag the fields that define a unique row into the Grouped Fields section. For instance, you could drag in Order ID, Customer Name, Product ID, and Order Date.
  4. Next, drag the numerical fields you want to summarize, like Sales and Quantity, into the Aggregated Fields section. Tableau will default to using the SUM aggregation, but you can change this to Average, Count, Maximum, etc., as needed.

By grouping by the fields that make a record unique and aggregating the measures, your output will have one row per unique combination of the grouped fields, effectively removing any duplicates.

When to use this method: Specifically when your goal is to de-duplicate your dataset based on a set of identifying fields.

Free PDF · the crash course

AI Agents for Marketing Crash Course

Learn how to deploy AI marketing agents across your go-to-market — the best tools, prompts, and workflows to turn your data into autonomous execution without writing code.

Method 4: Using a Join to Filter a List of Values

Sometimes you have an external list of records you need to remove. For example, maybe you have a separate spreadsheet titled cancellation_list.csv that contains all the OrderID values for cancelled orders. You want to remove all of these orders from your main sales data.

Step-by-Step Instructions:

  1. In your Tableau Prep flow, connect to your main sales data first.
  2. Next, connect to your secondary list (the cancellation_list.csv file) as a second Input step.
  3. Drag the Cancellation list step and drop it onto your main sales data step. Choose the Join option.
  4. Tableau Prep will ask you to configure the join.
  5. Now, look at the join results in the Profile pane. You will see that rows from your main data that were also found in the cancellation list will have values in the columns from that file. Rows that were not found will have null for the fields from the cancellation list.
  6. Add a new Clean Step after the Join step.
  7. Create a filter to remove the orders you want to exclude. You have two ways to do this:

Once the filter is applied, you'll have a dataset that excludes every OrderID from your external cancellation list.

When to use this method: When you have your removal criteria in a separate file or table. This is common for removing unsubscribed users, test accounts, or fraudulent orders when that data is managed elsewhere.

Final Thoughts

Cleaning your data by removing unnecessary rows is a foundational step in any analysis, and Tableau Prep provides multiple angles of attack. Whether you're quickly excluding a few visible values or building robust, automated rules with calculations and joins, mastering these methods will make your data preparation process much faster and more reliable.

As you can see, preparing data is crucial, but it's often a precursor to the real goal: getting answers. At Graphed , we help you simplify that entire workflow. By securely connecting directly to your marketing and sales data sources like Google Analytics, Shopify, and Salesforce, we remove much of the manual cleaning process. Instead of building filtering steps, you can just ask in plain English, "Show me my top 10 products by revenue this quarter, excluding returns," and instantly get a live, sharable dashboard. This allows you to jump straight from data to decision without getting bogged down in the prep work.

Related Articles