0
0
Tableaubi_tool~7 mins

Data relationships model in Tableau - Step-by-Step Guide

Choose your learning style9 modes available
Introduction
Data relationships model in Tableau helps you connect different tables without merging them. It lets you analyze data from multiple sources easily by defining how tables relate to each other.
When you have sales data in one table and customer info in another and want to analyze them together.
When your data comes from different sources but shares common fields like product ID or date.
When you want to avoid duplicating data by joining tables physically.
When you want Tableau to automatically choose the best way to combine data for your analysis.
When you want to keep your data model flexible and easy to update.
Steps
Step 1: Open
- Tableau Desktop and connect to your data sources
Data sources appear in the Data pane on the left side
Step 2: Drag the first table
- Data pane to the canvas area in the Data Source tab
The table appears as a box on the canvas
Step 3: Drag the second table
- Data pane to the canvas near the first table
A link icon appears between the two tables indicating a relationship
Step 4: Click the link icon
- Between the two tables on the canvas
The Edit Relationship dialog opens showing fields to define the relationship
πŸ’‘ Use common fields like Customer ID or Date to define the relationship
Step 5: Select matching fields
- Edit Relationship dialog for each table
Fields are linked showing how tables relate
πŸ’‘ You can add multiple field pairs if needed
Step 6: Click OK
- Edit Relationship dialog
The relationship is saved and shown on the canvas
Step 7: Use the related tables in your worksheets
- Data pane and worksheet
You can drag fields from both tables and Tableau combines data automatically
Before vs After
Before
Two separate tables with no connection; dragging fields from both causes errors or duplicates
After
Tables linked by relationships; dragging fields from both shows combined data correctly without duplication
Settings Reference
Relationship fields
πŸ“ Edit Relationship dialog on the Data Source tab
Defines how tables relate to each other
Default: No fields selected
Cardinality
πŸ“ Edit Relationship dialog
Specifies how many matching rows exist between tables
Default: Automatically detected
Referential Integrity
πŸ“ Edit Relationship dialog
Helps Tableau optimize queries if you know all related rows exist
Default: Not enforced
Common Mistakes
Using joins instead of relationships for all cases
Joins combine tables physically and can cause data duplication or loss
Use relationships to keep tables separate and let Tableau combine data as needed
Not selecting correct matching fields in the relationship
Incorrect fields cause wrong data combinations or empty results
Choose fields that uniquely identify related records in both tables
Ignoring cardinality settings
Wrong cardinality can lead to incorrect aggregations or performance issues
Set cardinality to match your data’s real relationships
Summary
Data relationships model connects tables logically without merging them physically.
It helps analyze data from multiple tables easily and avoids duplication.
Remember to select correct matching fields and set cardinality properly.