Troubleshooting
Join Issues in Tableau
Learn to identify and fix row duplication and row explosion caused by joins: the most common data modeling pitfall in Tableau.
What Is a Join?
A join combines rows from two or more tables based on a related column between them. When you drag a second table into Tableau's data source pane, Tableau creates a join on a shared field.
One-to-Many Relationships
Most joins involve a one-to-many relationship: one row in Table A matches multiple rows in Table B. This is expected and normal: for example, one customer can have many orders.
The Problem: Many-to-Many
Trouble starts when both tables have duplicate values in the join key. This creates a many-to-many join, where every matching row in Table A pairs with every matching row in Table B.
The Row Explosion Rule
If Customer #7 appears 3 times in Orders and 4 times in Returns, the join produces \( 3 \times 4 = 12 \) rows for that single customer: a row explosion.
Why It Matters
Joins vs. Relationships
| Join | Relationship | |
|---|---|---|
| When Combined | At the data source level | At query time (lazy) |
| Duplicate Risk | High: creates flat table | Low: independent queries |
| Aggregation | On the combined table | Per-table, then stitched |
| When to Use | Same granularity tables | Different granularities |
| Tableau Default | Must open physical layer | Yes (since v2020.2) |
How to Detect the Problem
How to Fix Row Explosion
Example 1: A Clean Join
Orders (3 rows) joined to Customers (3 rows) on CustID. Each CustID is unique in the Customers table.
Example 2: A Problematic Join
Now join Orders to Returns, both keyed on CustID. Customer A has 2 orders and 2 returns.
Example 3: Fixing the Explosion
Three strategies to get the correct \( \text{SUM}(\text{Amt}) = \$100 \) from the same data:
LOD Expressions to the Rescue
When you cannot avoid a many-to-many join, Level of Detail (LOD) expressions let you calculate measures at the correct grain.
Understanding Granularity
The granularity of a table is the level of detail each row represents. Join issues occur when two tables have different granularities.
Common Mistakes
Question 1 of 5
Table A has 4 rows where \( \text{CustID} = 10 \), and Table B has 3 rows where \( \text{CustID} = 10 \). How many rows will a join on CustID produce for this customer?
Question 2 of 5
Which of the following is the most reliable first indicator that a join has caused row duplication?
Question 3 of 5
What is the main advantage of using a Tableau Relationship instead of a physical join?
Question 4 of 5
You have a joined dataset with duplicated rows. Which LOD expression would correctly calculate the total sales per order without double-counting?
Question 5 of 5
You must join two tables that both have multiple rows per CustID. Before joining, you should: