Tableau Data Blending and Joins
Real-world analysis rarely uses one table of data. Sales data lives in one file, customer details in another, targets in a spreadsheet, and web analytics in a database. Tableau combines these sources through Joins and Data Blending. Each method works differently and suits different situations.
Joins
A join combines two tables at the row level before Tableau builds any chart. The result is a single merged table. Both tables must come from the same data source connection. Joins produce one unified dataset — all the columns from both tables are available together.
Analogy: Joining Two Lists
Orders Table: Customers Table: Order ID | Customer ID | Sales Customer ID | Name | City ---------|-------------|------ ------------|-------|-------- 1001 | C-01 | $500 C-01 | Alice | Mumbai 1002 | C-02 | $300 C-02 | Bob | Delhi 1003 | C-01 | $800 C-03 | Carol | Pune After JOIN on Customer ID: Order ID | Customer ID | Sales | Name | City ---------|-------------|-------|-------|-------- 1001 | C-01 | $500 | Alice | Mumbai 1002 | C-02 | $300 | Bob | Delhi 1003 | C-01 | $800 | Alice | Mumbai
Types of Joins
| Join Type | What It Returns | When to Use |
|---|---|---|
| Inner Join | Only rows that match in both tables | When you only want records that exist in both |
| Left Join | All rows from the left table + matching rows from the right | Keep all orders even if no customer record exists |
| Right Join | All rows from the right table + matching rows from the left | Keep all customers even if they have no orders |
| Full Outer Join | All rows from both tables, nulls where no match exists | When you want to see all records from both sides |
Diagram: Join Types
Left Table: Orders Right Table: Customers
[A] [B] [C] [B] [C] [D]
Inner Join: [B] [C] (only matching)
Left Join: [A] [B] [C] (all left + matched right)
Right Join: [B] [C] [D] (all right + matched left)
Full Outer: [A] [B] [C] [D] (everything from both)
Setting Up a Join in Tableau
- On the Data Source page, drag the first table to the canvas
- Drag a second table next to the first
- A join icon (two overlapping circles) appears between them
- Click the join icon to open the join editor
- Select the join type and the matching field (join key) in each table
Union
A Union stacks two tables vertically — rows from the second table append below the first. Both tables must have the same columns. Use Union when you have data split across multiple files with identical structure — for example, monthly sales files (January.xlsx, February.xlsx) that you want to analyze together.
Diagram: Union vs Join
Join (horizontal merge — adds columns):
Table A + Table B → Combined table with columns from A AND B
Orders + Customers → Order ID, Sales, Customer Name, City
Union (vertical stack — adds rows):
Table A +---+ Table B
Jan data | Feb data
v
Jan data
Feb data (rows stacked below)
Data Blending
Data Blending combines data from two different data source connections. Unlike Joins, the sources do not need to come from the same database. Blending works at the aggregate level — Tableau queries each source separately, then combines the results in the view.
When to Use Blending vs Joins
| Situation | Use |
|---|---|
| Both tables are in the same database | Join |
| One table is in Excel, another in a database | Blend |
| Row-level detail needed from both sources | Join |
| Aggregate-level comparison between sources is enough | Blend |
| Sources have different granularities | Blend |
How Blending Works
One data source is the Primary source. Other sources are Secondary. Tableau queries the Primary source for all dimensions. It then queries each Secondary source separately using a linking field — a field with matching values in both sources — and brings back aggregated Measures from the secondary. The two result sets merge in the view.
Blending Diagram
Primary Source (Sales database): Region | SUM(Sales) East | $1,300 West | $900 Secondary Source (Budget Excel file): Region | Budget East | $1,200 West | $1,000 Linking field: Region Blended View: Region | SUM(Sales) | Budget East | $1,300 | $1,200 West | $900 | $1,000 Now calculate: SUM(Sales) vs Budget on the same chart
Setting the Blend Link
Tableau auto-detects linking fields when they share the same name in both sources. If names differ (e.g., "Region" in one and "Sales Region" in the other), manually set the link. Go to Data menu → Edit Blend Relationships. Map the fields that should link the two sources.
Blending Limitation: Secondary Source Aggregates Only
Secondary source data always arrives aggregated. You cannot see individual row-level detail from a secondary source in the view. If you need row-level data from both sources, use a Join instead (after loading the Excel file into the same data connection).
Summary
Joins merge tables horizontally at the row level within the same data connection. Inner Joins return only matching rows. Left and Right Joins keep all rows from one side. Unions stack tables vertically — same columns, different rows. Data Blending combines separate data source connections at the aggregate level using a linking field. Use Joins for row-level detail from tables in the same source. Use Blending for aggregated comparisons across different sources like a database and an Excel file side by side.
