top of page

Mastering the Tableau Data Model

hands typing on a keyboard

Overview

The Tableau data model is the foundational structure that organizes and manages how data is connected, combined, and queried within Tableau for analysis and visualization. It determines how data from one or more sources is brought together, influencing both the accuracy and flexibility of your analysis.

A data model can be simple, such as a single table. Or it can be more complex, with multiple tables that use different combinations of relationships, joins, and unions.

The Tableau data model has two layers:

tableau data model diagram

The Logical Layer

The logical layer is the default view that you see on the Data Source page canvas. It is where relationships between tables are defined, allowing for more flexible and scalable data modelling. Think of this layer as the relationship’s canvas in the Data Source page.

Note: Relationships describe how two or more tables relate based on a common field but does not merge the two tables together like in the case of joins.

Requirements for establishing relationships

  • When relating tables, the fields that define the relationship MUST be of the same data type.

  • You can’t define relationships based on geographic fields.

  • Circular relationships are not supported in the data model.

  • You can’t define relationships between published data sources.

Using relationships over data joins provides several advantages

  • You do not need to configure the join types between the tables.

  • Related tables remain separate and distinct, they are not merged into a single table.

  • Tableau uses relationships to generate correct aggregations and appropriate joins during analysis, based on the current context of the fields in use in a worksheet.

  • Unmatched measure values aren't dropped (no accidental loss of data).

  • Using relationships prevents data duplication and filtering issues that can sometimes result from joins.

  • Tableau generates queries only for the data that is relevant to the current view.

The Physical Layer

The physical layer is where you combine data between tables using joins and unions. Each logical table in Tableau contains at least one physical table, and you access the physical layer by double-clicking a logical table on the Data Source page. In the physical layer, you can create joins (represented by Venn diagrams) or unions to merge tables into a single, flattened table structure. This layer is essential for combining raw data tables before any higher-level relationships are defined in the logical layer.

Logical Layer vs. Physical Layer

The logical and physical layers can be summarized in the table below.

a table summarizing the logical and physical layer in tableau

Building a New Data Model

Multi-table Model

To build a multi-table model, drag the tables to the logical layer of the Data Source page canvas.

Adding more tables to the logical layer canvas - prompts Tableau to automatically create relationship based on the existing matching fields. If Tableau can’t determine the matching fields, you’ll need to select the matching fields.

a gif showcasing how to create a multi-table model in tableau

Single-table Model

To build a single table model, simply drag a table into the logical layer canvas of the Data Source page. Then proceed to the worksheet to analyze and visualize your data.

a gif showcasing how to create a single-table model in tableau

Single-table model containing other tables

You can add more data inside the single, logical table by double-clicking the table. This opens the physical layer of the Data Source page canvas. Where you can drag the tables, you want to join or union into the physical layer canvas. The physical tables are merged in their logical table.

a gif showcasing how to create a single-table model containing other tables in tableau

Conclusion

The Tableau data model organizes how data is structured, connected, and queried for analysis. It consists of two layers: the logical layer, where relationships between tables are defined without merging them, and the physical layer, where joins and unions occur. Relationships in the logical layer preserve data integrity and avoid duplication, enabling Tableau to dynamically combine relevant tables at query time for accurate, flexible analysis. This model supports combining data from diverse sources, optimizing performance, and ensuring consistency across visualizations, making it foundational for effective and scalable data analysis in Tableau.

If you like the work we do and would like to work with us, drop us an email on our contacts page and we’ll reach out!

Thank you for reading!

Original.png

We Support You Deliver Business-Focused Solutions That Enable Data-Driven Decision Making.

  • Tableau profile
  • YouTube
  • White LinkedIn Icon
  • Facebook
  • X

QUICK LINKS

CONTACT US

WhatsApp: +254 738 307 495

East Gate Mall, Donholm

3rd Floor Suite No. 3i

Nairobi, Kenya

Join our mailing list

bottom of page