How to Remove Duplicates in Tableau After Join

Cody Schneider••5 min read

Joining data tables in Tableau can sometimes lead to an unexpected problem: your numbers suddenly look inflated, and rows seem to be repeated. This frustrating issue of data duplication after a join is a common hurdle for many analysts. This article will explain exactly why this happens and give you several practical methods, from simple checks to powerful Level of Detail (LOD) expressions, to tidy up your data and restore confidence in your reports.

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 Do Duplicates Appear After a Join?

The root of the duplication problem usually lies in the relationship between the tables you're joining. When you join tables with a one-to-many or many-to-many relationship, Tableau needs to repeat rows from the "one" side to match every corresponding row on the "many" side. This isn't a bug, it's just how database joins work.

Let's use a standard e-commerce example. Imagine you have two tables:

  1. Orders Table: Contains one row for each unique order, with columns like Order ID, Customer Name, and Order Date.
  2. Order Items Table: Contains one row for every product within an order, with columns like Order ID, Product Name, and Product Price.

Let’s say a customer, Jane Doe, places one big order (Order ID: 101) for three different products. Here’s what the tables look like:

Orders Table:

Order Items Table:

When you join these tables in Tableau based on Order ID, Tableau creates a single, flat table. It takes the row from the Orders table and repeats it for each matching row in the Order Items table. The resulting joined table looks like this:

As you can see, Customer Name and Order Date are now duplicated three times. This is normal at the row level because each row represents a different product in that order. However, if you add a Shipping Cost of $10 to the Orders table, it will also be repeated three times in the joined view, leading to inflated totals when summed up.

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.

Before You Fix It: Define the "Duplicate"

First, it's key to understand what "duplicate" means in your context. The duplication at the row level—showing all products in an order—is intentional. The real issue arises when aggregating data. For example, summing Shipping Cost (which is $10 per order) across multiple rows would incorrectly total $30 instead of $10.

A simple validation view:

  1. Drag the unique identifier from your "one" table (e.g., Order ID) onto the Rows shelf.
  2. Drag the Tableau-generated Number of Records measure onto Text in the Marks card.

If any Order ID has a value greater than 1, you have a one-to-many relationship. The solution isn't to remove these rows but to tell Tableau how to calculate metrics correctly despite them.

Method 1: The Power of Level of Detail (LOD) Expressions

The most robust way to handle duplicate aggregation issues is with Level of Detail (LOD) expressions. LODs allow you to fix calculations at a specific level of granularity, separate from your view's dimensions. The FIXED LOD is particularly useful.

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

What is a FIXED LOD?

A FIXED expression calculates a value at the level of detail specified, regardless of what other dimensions are in your worksheet. Its general form:

{ FIXED [Dimension 1], [Dimension 2] : AGGREGATE([Measure]) }

This tells Tableau: "For every unique combination of Dimension 1 and Dimension 2, compute this single aggregate value."

Example: Fixing Inflated Sales & Shipping Costs

Suppose in our e-commerce example, the Orders table includes Shipping Cost, and Order Items has Product Price. When joined, Shipping Cost repeats per product.

Wrong Approach: Dragging Shipping Cost into your view and summing (SUM([Shipping Cost])) would produce an inflated total ($10 + $10 + $10 = $30).

Correct Approach: Use an LOD to get the shipping cost per order just once:

  1. Create a calculated field named "Shipping Cost per Order".
  2. Enter the formula:

{ FIXED [Order ID] : MIN([Shipping Cost]) }

This captures the shipping cost for each order only once.

Building the Calculation:

  • Go to the Analysis menu > Create Calculated Field.
  • Name it "Shipping Cost per Order".
  • Use the formula above.

Now, when you sum this new field, Tableau first finds the unique Shipping Cost per Order ID (e.g., $10), then sums those correct values, avoiding inflation.

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 Tableau Relationships (The "Noodle")

If you're on a recent version of Tableau, relationships can help avoid the issue altogether. Instead of creating joins, relationships keep tables separate and combine data based on context.

  • Relationships imply that Orders and Order Items are linked but not flattened into one table.
  • Tableau understands the different levels of detail and aggregates data correctly at visualization time.

Advantages:

  • No need for complex LODs.
  • Prevents duplication at the source.

When to Use:

  • For new projects aiming for flexible, scalable data models.
  • When you want Tableau to handle level-of-detail automatically.

Method 3: Modifying Data Upstream with Tableau Prep or SQL

Pre-aggregating data before it reaches Tableau can also resolve duplication issues.

  • Create separate aggregated tables:
  • Or, pre-calculate metrics like TotalOrderValue in your database view.

This approach shifts complexity away from Tableau into your data pipeline, simplifying dashboards.

Which Method Should You Choose?

  • For immediate fixes and flexibility: Use LOD expressions. They are powerful and keep your detailed data intact.
  • For new data connections: Use Relationships to prevent duplication issues from the start.
  • For performance/scalability: Handle calculations upstream via SQL or Tableau Prep.

Final Thoughts

Understanding and addressing join-induced duplicates is essential for accurate analysis in Tableau. Techniques like FIXED LODs or modern data modeling through Relationships can transform a potential headache into a robust solution.

While these skills are invaluable, sometimes managing data quality upfront is the simplest route. We built Graphed to automate much of this process. Simply connect your data sources and describe your desired insights in plain English, and Graphed handles connections, joins, and calculations automatically—delivering ready-made dashboards in seconds so you can focus on insights, not technical hurdles.

Related Articles