Tableau
Intermediate 14 min read Tableau

Connecting Data in Tableau

Joins, blends and unions — each one answers a different grain question

Tableau connects to files, databases, and cloud sources. You can join tables, blend data sources, and union stacks; each approach differs in grain, relationships and performance.

data connectionjoinblendunionrelationshipextractdata model
Prerequisites: Tableau Fundamentals
Before we start

What you will learn

  • Connect to a database and inspect its tables
  • Distinguish join, blend and union
  • Decide extract vs live connection
Introduction

What is this?

Tableau's data layer connects live to a source or into an extract. Within the data source you can relate tables (logical layer), join them physically, union same-shape tables, and cross data sources with blends. Each approach is a different answer to a grain question: joins widen rows, unions lengthen them, blends aggregate two sources at query time.

Motivation

Why do you need it?

  • Wrong grain is the #1 source of inflated numbers in Tableau workbooks.
  • Relationships keep filters correct without manual join paths.
  • Blends are the escape hatch when two sources have no single join keys.
  • Extract vs live decides refresh speed and governance model.
Think about it

Mental model

Imagine

Staffing a clinic: shifts, patients, rooms

Think of

Tableau data operations

Joins are like pairing each appointment with a room assignment (wider rows); unions are stacking Monday and Tuesday rosters into one list (longer); a blend is comparing the clinic's internal register with an external reimbursement sheet by a shared identity — aggregated per day, not row-by-row.

Mechanics

How it works

  • A connection dials the source; Tableau reads tables and fields into the data model.
  • Relationships define how tables logically relate without creating bloat at load.
  • Joins combine tables on a key horizontally; mismatched keys produce null or fan-out rows.
  • Unions append tables vertically when schemas match.
  • Blends join two data sources on common fields at query time, aggregating each side first.
  • Extracts snapshot data into a hyper store for fast refresh; live queries the source each view load.

The four ways Tableau combines data.

Connect
Relate
Join
Union
Blend
Extract
Hands-on

Examples

Union in the data model

Union in the data model
Table A: Jan_region.csv (region, month, revenue)
Table B: Feb_region.csv (region, month, revenue)
1. New data source > CSV > browse double-click Feb file too.
2. Tableau prompts to add it as UNION automatically.
3. Result: one source with months combined, rows appended.

The union stacks same-shape tables vertically. Unioning monthly files produces one clean rolling table — the correct approach when the grain is per-line across months.

Real world

In production

  • A commerce team relates Orders to Customers logically, then builds reports that never double-count lines.
  • A global team unions Saturday-Friday daily files into one rolling year-to-date view.
  • An agency blends internal billing data with external cost sheets on a common contract_id at aggregate grain.
Guidelines

Best practices

  • Pick the logical relationship layer for clean filters; use physical joins only when you must.
  • Always state the grain assumption in the workbook's data dictionary.
  • Prefere extracts for report-server workbooks; re-Aggregate and schedule refresh.
  • Keep joins one-to-many and from the 'many' side to avoid fan-out.
Watch out

Common mistakes

  • Joining two fact tables directly, doubling revenue in the views.
  • Using a union on tables with different columns, inadvertently dropping fields.
  • Blending when a proper relationship exists, causing LOD cross-filter surprises.
  • Connecting live to a 10GB table and watching every dashboard time out.
Root cause analysis

Common issues

Error
Revenue doubled after adding a table
Root cause

A many-to-many join fanned rows out

Fix

Switch to a logical relationship or deduplicate the keyed side.

Error
Blend pins with wrong totals
Root cause

Aggregation is done before linking on the primary key

Fix

Aggregate the secondary source to the same grain before blending.

Error
Extract never refreshes
Root cause

Schedule missing or credentials invalid

Fix

Set a refresh schedule on the extract and verify the service account.

When things break

Debugging tips

  • Count rows after each operation and compare to the sum of source tables.
  • Right-click a join and view the data preview to see duplicate/missing keys.
  • Check the connection type icon: live vs extract affects refresh behavior.
  • For blend issues look at the secondary source link icon on the field pill.
Interviews

Interview checkpoint

Practice

Hands-on lab

Join, Union and Blend by the Numbers
30 min · intermediate
In progress
Objectives
  • Connect two CSV sources
  • Join on a key and check row change
  • Union same-shape monthly files
  • Blend across data sources at grain

Join, Union and Blend by the Numbers

30 min · intermediate

0/5 steps
0%
sandbox · Linux sandbox
$
Try these commands
Test yourself

Quick quiz

0/2
1

Which operation stacks two tables with the same schema vertically?

2

A blend joins two data sources row-by-row like a SQL join.

Go deeper

Official documentation