How Do Relationships Differ from Joins in Tableau?

Cody Schneider••9 min read

If you're trying to combine different tables in Tableau, you've almost certainly run into a choice: should you use a relationship or a join? This decision determines how your data tables interact and can have a massive impact on the accuracy of your visualizations. This article will break down exactly how relationships and joins differ, so you can confidently choose the right one for your analysis.

GraphedGraphed

Build AI Agents for Marketing

Build virtual employees that run your go to market. Connect your data sources, deploy autonomous agents, and grow your company.

Watch Graphed demo video

What Are Joins in Tableau?

Let's start with the classic method: joins. A join is a way to combine tables by creating a single, new table based on a shared field or column. Think of it like merging two Excel spreadsheets side-by-side. You find a common column (like a CustomerID or OrderID), and you stitch the rows together where those values match. Once a join is created, Tableau treats the result as one fixed table for all your analysis.

Joins take place in what Tableau calls the physical layer of the data source. It’s the foundational level where you tell Tableau precisely how to build that single, wide table before you start dragging and dropping pills onto a worksheet.

There are four main types of joins you’ll encounter:

  • Inner Join: This returns only the rows that have a matching value in both tables. If a customer in your Customers table has never made a purchase in your Sales table, they will be excluded from the joined data.
  • Left Join: This returns all the rows from the first (left) table, and only the matching rows from the second (right) table. If a customer on the left has no matching sales on the right, their customer information will still be included, but the sales fields will be null.
  • Right Join: This is the opposite of a left join. It returns all the rows from the second (right) table and only the matching ones from the first (left) table.
  • Full Outer Join: This returns all rows from both tables. Where there are matches, the data is combined. Where there are no matches, Tableau fills in the missing side with null values. It gives you every possible piece of data from your tables.

Free PDF · the crash course

AI Agents for Marketing Crash Course

Learn how to deploy AI marketing agents across your go-to-market — the best tools, prompts, and workflows to turn your data into autonomous execution without writing code.

An Example of a Join

Imagine you have two simple tables:

  1. A Customers table with CustomerID and CustomerName.
  2. An Orders table with OrderID, CustomerID, and OrderValue.

If you perform a left join on CustomerID (with Customers as the left table), you create a new table that looks like this:

Every customer is listed, and next to their name, you see the details for every order they placed. But what if a customer placed three orders? In the joined table, that customer’s information (CustomerID and CustomerName) is duplicated three times, once for each order row. This duplication is a critical side effect of joins and can lead to problems if you’re not careful.

What Are Relationships in Tableau?

Introduced in Tableau 2020.2, relationships are a newer, more flexible, and often smarter way to combine data. Instead of merging tables into a single fixed sheet before analysis, relationships simply tell Tableau how different tables are related to each other. They "talk" to each other but remain separate until you build a view.

Relationships live in what Tableau calls the logical layer. Think of this as a more abstract, high-level map of your data. You draw a "noodle" between the tables to indicate their connection (e.g., Customers.CustomerID is related to Orders.CustomerID), and then Tableau intelligently figures out what kind of join to use on the fly, depending on which fields you use in a specific worksheet.

GraphedGraphed

Build AI Agents for Marketing

Build virtual employees that run your go to market. Connect your data sources, deploy autonomous agents, and grow your company.

Watch Graphed demo video

The 'Smart' Nature of Relationships

The magic of relationships is that they maintain the native level of detail, or granularity, for each table. The Customers table stays at the customer level, and the Orders table stays at the order level.

When you build a viz, Tableau looks at the dimensions and measures you've added and creates the appropriate join in the background for just that specific query. This is called a "contextual join." So, one worksheet might need an inner join, while another might need a left join, and relationships handle that automatically based on the context.

Using the same Customers and Orders tables, if you create a relationship between them on CustomerID, they remain two distinct tables in your data source. Tableau understands the connection but doesn’t flatten them together upfront. This prevents the data duplication issue seen with joins by default.

Key Differences: Joins vs. Relationships

Understanding when to use each comes down to knowing their core differences. Here’s a side-by-side comparison of the most important concepts.

1. Data Duplication and Aggregation

  • Joins: Joins can create duplicate data when tables have a one-to-many relationship (one customer, many orders). This can inflate your measures. For example, if you join a Sales table with a Sales Reps table and a rep is linked to 10 sales, their Salary might be duplicated 10 times. Simply summing the Salary column would give you 10x their actual salary. You'd need to use complex Level of Detail (LOD) expressions like {FIXED [Sales Rep]: MIN([Salary])} to get the right number.
  • Relationships: Relationships avoid this problem altogether because the tables are never fully flattened. When you pull SUM([OrderValue]), Tableau aggregates it correctly from the Orders table. When you pull COUNTD([CustomerID]), it's counted correctly from the Customers table. Relationships naturally respect the granularity of each table, making your calculations far more straightforward and accurate.

2. When Data is Combined

  • Joins: The join is executed at the data source level, before any analysis begins. The resulting table is static and rigid. All your worksheets use this one pre-joined data structure.
  • Relationships: The combination happens at the worksheet level, during analysis. Tableau creates a temporary, contextual join in the background for each viz you create. This makes the data source much more flexible, as it’s not locked into a single combination.

3. Join Type and Control

  • Joins: You have explicit control. When you set up the join, you must choose whether it's an INNER, LEFT, RIGHT, or FULL OUTER join. That decision is permanent for the data source.
  • Relationships: You don’t pick a join type. You simply define the fields that connect the tables. Based on the metrics you drag into your view, Tableau smartly decides what kind of join makes the most sense for that particular viz. This flexibility is powerful but means you give up some explicit control.

4. Data Integrity and Missing Values

  • Joins: Joins, especially INNER or LEFT joins, can filter out data permanently. If a row in one table doesn't have a match in the other, it might be dropped from your dataset entirely depending on the join type.
  • Relationships: Relationships preserve all the data from each table. Records aren't dropped. If you build a visualization that shows customers and their orders, Tableau may perform an effective left join. If you build another that only lists all orders regardless of customer, it will show everything from the Orders table. It preserves all your information, giving you a full picture.

Free PDF · the crash course

AI Agents for Marketing Crash Course

Learn how to deploy AI marketing agents across your go-to-market — the best tools, prompts, and workflows to turn your data into autonomous execution without writing code.

So, When Should You Still Use a Join?

While relationships are now the recommendation and default for most use cases, joins are still valuable in specific situations.

  • When You Intentionally Want to Filter Data: If you absolutely need to include only records that exist in two tables (an inner join), and you want this filter to apply to your entire workbook, setting up an inner join in the physical layer is a direct way to do that.
  • Working with Row-Level Security: Joins are often required to set up specific row-level security models where user data needs to be hard-filtered right at the data source level.
  • Simplifying Very Simple Data Models: If you have two tables with a clear and permanent one-to-one relationship (e.g., one Employee ID table and another Employee Details table where each employee has exactly one record in both), a join is simple, effective, and works perfectly fine.
  • When Your Data Has Been Specifically Structured for It: If your database team has already created perfectly clean, denormalized tables specifically for you to join, you can continue to do so.

When Should You Use a Relationship?

By default, you should always start with a relationship. They have become Tableau's best practice for combining data sources, especially in these common scenarios.

  • When Tables Have Different Levels of Granularity: This is the number one reason to use relationships. If you have daily sales pointing to weekly customer targets, or event-level data and monthly summaries, relationships handle the different grains of data without errors.
  • To Avoid Complicated LOD Calculations: If you find yourself consistently writing FIXED, INCLUDE, or EXCLUDE expressions to deal with duplicate values caused by joins, switch to relationships. They often solve the need for these workarounds automatically.
  • For Flexible and Multi-Purpose Data Sources: If you're building a single data source that will be used by multiple people to create many different types of reports, relationships provide the flexibility for a wide variety of analyses without creating aggregation errors.
  • When Combining Multiple Fact Tables: If your analysis involves more than two main tables (e.g., sales, store inventory, and customer support tickets all linked to a store dimension), relationships are designed to manage these complex scenarios much more efficiently than a series of joins.

Final Thoughts

In short, joins create a single, fixed table before analysis, giving you full control but risking data duplication and inflexibility. Relationships, on the other hand, create a flexible "map" of your data, allowing Tableau to combine tables smartly and contextually at the time of analysis, which prevents aggregation errors and simplifies your workbook.

Manually connecting data sources and wrestling with joins, relationships, and data models can be frustrating and time-consuming. This is exactly why we built Graphed. We wanted to eliminate the friction between having data and getting answers. Instead of spending hours in Tableau's data source editor, you can connect your platforms to our service in seconds and use simple, natural language prompts like "Show me my sales trend by customer name for last quarter." Graphed generates an interactive, real-time dashboard for you, so you can focus on insights instead of setup.

Related Articles