How to Build a Data Model in Tableau

Cody Schneider9 min read

Getting your data model right in Tableau is the essential first step to creating powerful, accurate dashboards. A solid model is the foundation for every chart, calculation, and insight you’ll generate. This guide walks you through exactly how to build a data model, covering the core concepts of relationships, joins, and unions without the overwhelming technical jargon.

GraphedGraphed

Still Building Reports Manually?

Watch how growth teams are getting answers in seconds — not days.

Watch Graphed demo video

What is a Data Model in Tableau (And Why Does It Matter)?

Think of a data model as the instruction manual for your data. You likely have information scattered across different files or platforms - sales data in one spreadsheet, customer details in another, and marketing campaign results in a third. A data model tells Tableau how these separate tables are connected, enabling you to analyze them together.

For example, you can use a data model to connect your Shopify Orders table with your Salesforce Contacts table. This allows you to build a dashboard that answers questions like, "Which of our marketing leads are generating the most revenue?" Without a data model, your tables are just separate, silent islands of information.

Why is this so important? Because a poorly constructed model can lead to inaccurate numbers, duplicate data, and dashboards that are misleading or completely wrong. This can cause you to make poor business decisions based on faulty information. On the other hand, a well-built data model ensures your analytics are reliable, fast, and flexible, which means you can trust the insights you uncover and confidently act on them.

The Core Concepts: Relationships, Joins, and Unions

Before you start dragging tables onto the canvas, it’s important to understand the three primary ways Tableau combines data. Each method serves a different purpose, and choosing the right one is critical for building an effective model.

GraphedGraphed

Still Building Reports Manually?

Watch how growth teams are getting answers in seconds — not days.

Watch Graphed demo video

Relationships: The Modern, Flexible Way

Relationships are Tableau’s newest and recommended method for combining data. Visually, they appear as flexible lines, affectionately known as "noodles," connecting your data tables.

Instead of smashing tables together into one giant table from the start, relationships keep your tables separate. They work by telling Tableau how tables are related based on a common field (like CustomerID or Email Address). When you build a visualization in a worksheet, Tableau intelligently queries only the necessary data from the relevant tables at that moment. This is far more efficient and avoids many common issues like data duplication.

Imagine you have an Orders table and a Customers table. You can create a relationship between them using the Customer ID field. They remain separate tables, but Tableau now understands their connection. If you create a chart showing sales by customer region, Tableau will query both tables on-the-fly to get the information you need, giving you the right answer without creating a messy, pre-joined table.

Relationships are the go-to choice for most situations due to their flexibility and ability to handle data at different levels of detail (like when one customer has many orders).

Joins: The Old-School Merger

Before relationships, joins were the standard way to combine data in Tableau. A join physically merges multiple tables into a single, often much wider, table before your analysis even begins. You have to decide which columns from each table to bring together into this new, flat structure.

There are four main types of joins, usually visualized with Venn diagrams:

  • Inner Join: Returns only the rows that have a match in both tables. If a customer has no orders, they won't appear in an inner join of Customers and Orders.
  • Left Join: Returns all the rows from the left table and any matching rows from the right table. This would give you all your customers, even a customer who hasn't placed an order yet.
  • Right Join: The opposite of a left join. It returns all rows from the right table and any matching rows from the left. A bit less common, but useful in certain scenarios.
  • Full Outer Join: Returns all rows from both tables. If there’s a match, it will be in the same row, if not, it will show nulls for the missing side.

While powerful, joins are less flexible than relationships. Since they create a static, combined table upfront, you can sometimes get duplicated values if your tables have different levels of detail. For instance, if you join Customers to Orders, the customer's information (name, city, etc.) will be repeated for every single order they’ve placed, which can inflate totals if you aren't careful with your calculations.

Unions: Stacking Your Data

While relationships and joins combine tables side-by-side based on common fields, unions stack them vertically, on top of each other. This is useful when you have multiple files or tables with the exact same structure (i.e., the same column headers).

A perfect example is having monthly sales data in separate files: January_Sales.csv, February_Sales.csv, and March_Sales.csv. Each file has the same columns: OrderID, Product, Amount, and Date. A union lets you append these files into a single, comprehensive table that contains all sales data for the quarter. You aren't creating new columns, you're just adding more rows.

GraphedGraphed

Still Building Reports Manually?

Watch how growth teams are getting answers in seconds — not days.

Watch Graphed demo video

Step-by-Step Guide: Building Your First Data Model in Tableau

Let's walk through a practical example. Imagine we have three data sources for a small e-commerce business:

  1. An Excel file named Shopify Orders with order details.
  2. A Google Sheet named Customer Details with customer information from our CRM.
  3. Another Excel file named Product Returns containing information about returned orders.

Step 1: Connect to Your First Data Source

First, open Tableau and connect to your primary data file. In the Connect pane on the left, choose Microsoft Excel and select your Shopify Orders.xlsx file.

Once connected, you’ll be taken to the Data Source page. Tableau will list the sheets from your Excel file on the left. Drag the Orders sheet onto the canvas area that says "Drag tables here." This establishes your first table in what Tableau calls the 'logical layer.' You’ll see a preview of your order data in the grid below.

Step 2: Add a Second Table with a Relationship

Now you need to add your customer data. Click Add next to Connections in the top left, select Google Drive, and sign in to connect to your Customer Details sheet.

Next, find the Customers table in the left pane and drag it onto the canvas near the Orders table. Tableau is smart and will probably detect a common field and automatically create a relationship (a "noodle") between them.

Step 3: Configure the Relationship

The noodle represents the link. Click on it to open the Edit Relationship settings. Here, you ensure the connection is correct. For example, Tableau might have correctly matched the Customer ID field from the Orders table to the ID field in the Customers table.

You can also review the Cardinality (e.g., one customer to many orders) and referential integrity settings. For most cases, the default settings are fine. Click the 'X' to close the settings, and your relationship is now configured. You can now use fields from both Orders and Customers throughout your Tableau workbook.

GraphedGraphed

Still Building Reports Manually?

Watch how growth teams are getting answers in seconds — not days.

Watch Graphed demo video

Step 4: Add a Third Table with a Join

What if you want to join a table directly to another? Let's bring in the Product Returns data. Assuming you want this tightly coupled with your Orders table so you always analyze them together.

Double-click the Orders logical table on the canvas. This takes you down into the 'physical layer' for that table. Here, you can perform joins.

Connect to your Product Returns.xlsx file. Now drag the Returns sheet from the left pane and drop it onto the canvas, to the right of your Orders table. A Venn diagram icon for a join will appear. Tableau will default to an Inner Join. Since you want to see all orders, regardless of whether they were returned, click on the join icon and select a Left Join to keep all records from your Orders table.

Make sure the join clause is correct, linking the tables on Order ID. Now you have a single, physical table that combines orders and their return status.

Step 5: Check Your Model and Return to the Worksheet

After setting up your model, take a look at the data grid at the bottom of the page. You should see columns from all three original tables, combined just as you specified. You can now leave the editor, and Tableau will take you back up to the logical layer view, where your combined 'Orders/Returns' table is now related to your Customers table.

Click on Sheet 1 at the bottom of the screen. In the worksheet, you'll see your data organized by table in the Data pane on the left, ready for analysis.

Best Practices for a Healthy Data Model

Building a model is one thing, building a good model is another. Here are a few tips to help you keep things clean and efficient:

  • Start with Clean Data: The most robust Tableau model can't fix messy, inconsistent source data. If your Excel files are disorganized, use Tableau’s Data Interpreter feature to help clean them up automatically during the connection process.
  • Use Meaningful Names: Rename cryptic field names like cust_id_x1 to something clear like 'Customer ID'. Just right-click the column header in the Data Source pane and choose Rename.
  • Check Your Data Types: Tableau does a good job of guessing whether a field is a number, a date, or a string of text, but it’s always wise to double-check. Click the icon above each column (e.g., # for numbers, a calendar for dates) to verify and change it if needed.
  • Prefer Relationships Over Joins: Unless you have a very specific reason to create a physical join, stick with creating relationships in the logical layer. They are more flexible, perform better, and prevent many common analytic headaches.

Final Thoughts

Mastering data modeling in Tableau transforms it from a simple charting tool into a powerful analytics engine. By understanding how to properly use relationships, joins, and unions, you are building a reliable foundation that gives you the confidence to trust your numbers and make smarter, data-driven decisions for your business.

But we also know that managing and modeling data, especially from multiple platforms, can be a time-consuming headache. We created Graphed because we wanted to eliminate this manual work entirely. Instead of struggling with joins and relationships across tools like Google Analytics, Shopify, and Salesforce, you just connect your sources and describe the dashboard you want in plain English. Graphed automatically models the data in the background and builds live, interactive reports for you in seconds, saving you from setup challenges so you can get straight to the insights.

Related Articles