01 / 20

Multiple Data Sources
in Tableau

Learn how to connect, blend, and join multiple data sources in a single workbook: when to use each method, and how to avoid common pitfalls.

Tableau

What Is a Data Source?

In Tableau, a data source is a connection to structured data: a spreadsheet, database table, cloud service, or file. Every worksheet in your workbook draws from at least one data source to build visualizations.

Primary
The first data source you drag onto a sheet: it defines the default field list.
Secondary
An additional data source used on the same sheet. This term is most common in data blending.

Why Use Multiple Sources?

Real-world data rarely lives in a single table. Sales numbers sit in one database, customer demographics in a CRM, and geographic data in a spreadsheet. Combining them unlocks deeper insights.

1
Enrich analysis: Add context like region names or product categories from a lookup table.
2
Compare metrics: Show planned vs. actual figures when targets live in a separate file.
3
Bridge systems: Combine data from different departments or software platforms.

Three Ways to Combine Data

Tableau provides three distinct methods for working with multiple data sources. Each operates at a different level and has different strengths.

Relationships
The default model in the Data Source tab: tables are related by shared fields without specifying a join type upfront.
Joins
Physically merge rows from two tables into a single flat table based on matching key columns.
Blending
Link a secondary data source to a primary one at the sheet level, matched on common dimensions.

The Tableau Data Model

RELATIONSHIPS (Logical Layer) Orders Order ID, Customer ID Customers Customer ID, Region Products Product ID, Category JOINS (Physical Layer) Table A Table B JOIN BLENDING (Sheet Level) Primary Secondary link on dimension

Relationships: The Default Approach

Since Tableau 2020.2, relationships are the recommended way to combine tables within a single data source. You drag tables onto the canvas and define which fields relate them.

1
No upfront join type: Tableau decides how to query each table based on what fields you use in the viz.
2
Preserves grain: Aggregations stay at the correct level of detail for each table, reducing duplicated rows.
3
Flexible: Related tables can have different granularity: Tableau handles the mapping automatically.

Joins: The Physical Merge

Inner Left Right Full Outer Shading shows which rows are kept

A join physically combines rows into one flat table. You choose the join type (Inner, Left, Right, Full Outer) and the key column(s). Joins happen at the physical layer: double-click a logical table to open it.

Data Blending: The Sheet-Level Link

Data blending connects two entirely separate data sources on a worksheet. The secondary source is queried independently and its results are left-joined onto the primary source using shared linking fields.

1
Primary source: The first data source you use on a sheet. Shown with a blue checkmark icon.
2
Secondary source: Added after. Shown with an orange checkmark. Its values aggregate before blending.
3
Linking field: A dimension shared between both sources. Tableau auto-detects matches but you can edit them.

Relationships vs. Joins vs. Blending

Feature Relationships Joins Blending
Scope Data source (logical) Data source (physical) Per worksheet
Row duplication Minimal Possible None
Aggregation Context-aware Aggregates after flattening Secondary pre-aggregated
Cross-database Same connection Same connection Any sources
LOD expressions Full support Full support Limited

Step-by-Step: Choosing Your Method

1
Identify your sources: Are both tables in the same connection (same database, same file)? If yes, go to step 2. If no, go to step 4.
2
Try a relationship first: Drag both tables onto the Data Source canvas. Define the relating field. This preserves granularity and is the safest default.
3
Use a join only if needed: If you must create a flat table (e.g., union-like scenarios or specific row-level matching), double-click a logical table and define the join type.
4
Use blending for cross-database: Add both data sources to the workbook. On a worksheet, use fields from the primary, then drag a field from the secondary. Set the linking field.
5
Validate results: Check row counts, totals, and null values. Compare against known benchmarks to confirm data integrity.

Example 1: Relating Orders to Customers

Orders Order ID Customer ID Sales, Profit Customers Customer ID Name, Region Segment = Linked on Customer ID

With this relationship, you can freely use Sales from Orders and Region from Customers on the same sheet. Tableau aggregates each table at its own grain before combining.

Example 2: Unioning Two Transaction Tables

Suppose you have Online Orders and In-Store Orders in the same database. Both share the exact same schema. You want to stack them into a single table of all orders.

Online Orders In-Store Orders All Orders (Union)

Example 3: Blending Sales with Targets

Sales data lives in a SQL database. Sales targets are in an Excel file from the finance team. You want to compare actual vs. target on the same chart.

SQL: Sales Region, Month, Revenue PRIMARY Excel: Targets Region, Month, Target SECONDARY LINK Linking fields: Region + Month Secondary aggregates Target before merging

Common Mistakes to Avoid

✕ Joining Everything
Using joins when a relationship would suffice. Joins flatten data and can inflate row counts, causing incorrect aggregations.
✕ Ignoring Granularity
Combining tables at different levels of detail (daily vs. monthly) without understanding how Tableau aggregates. This silently distorts totals.
✕ Blending on Wrong Field
Linking on a field that looks the same but has mismatched values (e.g., "NY" vs. "New York"). Always verify linking field values match.

Summary: When to Use What

Scenario Best Method Why
Tables in same database Relationship Preserves grain, flexible queries
Need a flat, row-level table Join Explicit control over row matching
Same schema, stack rows Union Appends without key matching
Different databases/systems Blend Only option for cross-database
Supplemental lookup table Relationship No row duplication, clean model

Question 1 of 5

In Tableau's data model, relationships operate on which layer?

Question 2 of 5

Data blending in Tableau always performs which type of operation between the primary and secondary source?

Question 3 of 5

Your sales data is in a PostgreSQL database and your budget targets are in an Excel spreadsheet. What is the most appropriate method to combine them on a single worksheet?

Question 4 of 5

What is a major risk of using a join instead of a relationship when combining a one-to-many table pair?

Question 5 of 5

You have two tables in the same SQL database: Employees and Departments, linked by Department ID. What should you try first?