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.
What you will learn
- Connect to a database and inspect its tables
- Distinguish join, blend and union
- Decide extract vs live connection
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.
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.
Mental model
Staffing a clinic: shifts, patients, rooms
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.
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.
Examples
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.
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.
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.
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.
Common issues
Revenue doubled after adding a tableA many-to-many join fanned rows out
Switch to a logical relationship or deduplicate the keyed side.
Blend pins with wrong totalsAggregation is done before linking on the primary key
Aggregate the secondary source to the same grain before blending.
Extract never refreshesSchedule missing or credentials invalid
Set a refresh schedule on the extract and verify the service account.
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.
Interview checkpoint
Hands-on lab
- 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
Quick quiz
Which operation stacks two tables with the same schema vertically?
A blend joins two data sources row-by-row like a SQL join.