How to Join Two Datasets in Tableau

Cody Schneider••9 min read

Trying to analyze data that lives in separate tables or files can feel like you're trying to assemble a puzzle with pieces from two different boxes. One dataset has customer information, another has their order history. Alone, they're useful, but combined, they tell a much clearer story. We're going to walk through exactly how to join two datasets in Tableau to build that complete picture.

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

This tutorial will cover why joining data is important, break down the different types of joins, provide step-by-step instructions for performing them in Tableau, and offer solutions for common issues you might run into.

First, Why Should You Join Data at All?

Joining datasets is a fundamental concept in data analysis. It's the process of combining rows of data from two or more tables based on a related column between them. Think of it this way: your sales data might tell you what products were sold, but your customer relationship management (CRM) data tells you who bought them. By joining these two sources, you can start answering more meaningful questions, like:

  • Which customer demographics purchase our most profitable products?
  • What is the geographic distribution of our high-volume buyers?
  • Are customers acquired through Facebook Ads more valuable over time than those from Google Ads?

By bringing different datasets together, you create context. Instead of just looking at isolated metrics, you can analyze relationships, spot trends, and uncover insights that would otherwise remain hidden.

Understanding the Four Main Types of Joins

The key to successfully combining your data is choosing the right type of join. Tableau offers four main options, and your choice will determine which records are kept or discarded from your final dataset. Let's use a simple example of two tables: one with Customer Info and another with Order Details. The common column we will join on is CustomerID.

Here’s a breakdown of the four join types:

1. Inner Join

What it does: An Inner Join returns only the records that have matching values in both tables. Think of it as the intersection of your data.

Example: If you perform an Inner Join on the Customer Info and Order Details tables, your resulting dataset will only include customers who have made an order. Any customer in your Customer Info table who hasn't placed an order yet will be excluded. Likewise, any orders that can't be matched to a customer (which is unlikely but possible with messy data) would also be dropped. It shows you only what you have complete information on for both sides.

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.

2. Left Join

What it does: A Left Join returns all records from your left table, plus the matched records from your right table. If there’s no match in the right table for a record on the left, you'll see empty or 'null' values for the columns from the right table.

Example: Let's say Customer Info is your left table. A Left Join will give you a list of all your customers, regardless of whether they’ve ever placed an order. For customers who have made purchases, you'll see their full order details. For those who haven’t, the order-related columns (OrderID, OrderDate, Product) will be null. This is extremely useful for finding customers who haven't converted yet.

3. Right Join

What it does: A Right Join is the mirror image of a Left Join. It returns all records from the right table and the matched records from the left table. If no matches are found, you’ll see nulls for columns from the left table.

Example: With the Order Details table on the right, this join would show you all orders. If an order existed in your system that didn’t have a matching CustomerID in your customer table, you’d still see that order, but the customer info fields (CustomerName, Email, etc.) would be null. In practice, left joins are far more common than right joins, as you can typically achieve the same result by simply switching which table is on the left.

4. Full Outer Join

What it does: A Full Outer Join returns all records when there's a match in either of the tables. It’s like a combination of a Left Join and a Right Join.

Example: This join would give you every single customer and every single order. You’d see customers who haven't ordered yet (with nulls in order fields) and any orders that don’t link to a known customer (with nulls in customer fields). It gives you the most complete, unfiltered view of all your disparate data in one place.

A Step-by-Step Guide to Joining Tables in Tableau

Now that you understand the concepts, let’s go through the practical steps of creating a join in Tableau. We’ll use a relatable scenario: joining a Google Sheet of Campaign Data with a sales table from our connected Shopify store to analyze marketing ROI.

Step 1: Connect to Your First Data Source

Open Tableau and in the “Connect” pane on the left, choose your first data source. This could be anything from an Excel file, a Google Sheet, to a direct connection to a database like PostgreSQL or a SaaS app like Salesforce. Once you connect, Tableau will display the available tables or sheets. For our example, we'll connect to Google Sheets and find our Campaign Data sheet.

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

Step 2: Drag Your First Table to the Canvas

Simply drag the table you want to use (in this case, "Campaign Data") from the left pane and drop it onto the area that says “Drag tables here.” This becomes the "left" table. You'll see Tableau displays the columns and a sample of the rows from your data.

Step 3: Connect to or Add Your Second Data Source

To join a second dataset, click the “Add” connection button at the top of the Data Source pane. Tableau will let you connect to another source in the same way you did the first one. Let’s connect to our Shopify account. After connecting, the Shopify tables will appear in the left pane, right underneath your Google Sheets data.

Step 4: Drag Your Second Table to Create the Join

Now, drag your second table ("Sales") and drop it to the right of your first table on the canvas. Tableau will automatically display a Venn diagram icon (the "Join Noodle") connecting the two tables. Tableau tries to guess the relationship based on common field names. Your screen will now show the join configuration dialog.

Step 5: Configure the Join Clause

This is where you tell Tableau exactly how the two tables relate to each other.

  • Select the Join Type: Click the Venn diagram icon. This opens a dropdown menu where you can choose Inner, Left, Right, or Full Outer. Select the type that fits your analysis goal.
  • Specify the Join Key(s): Below the join type selection, specify the "join clause" — the common field(s) linking your tables. A 'join key' is the shared column, like CustomerID or Email Address. Tableau might guess this for you, but it’s important to verify it's correct. If it guesses wrong, you can click on the field names and choose the correct matching columns from each table.

For our example, we might use "Campaign Name" as the join key if it exists in both the Campaign Data from our Google Sheet and is captured in the Sales data from Shopify through a UTM parameter. After configuring this, the data grid at the bottom will update to reflect the newly joined dataset.

Common Challenges When Joining Datasets and How to Fix Them

Creating joins isn't always smooth sailing. Here are a few common issues and troubleshooting tips.

Problem: Duplicate Rows

Sometimes, after a join, your row count might skyrocket unexpectedly. This usually happens in a one-to-many relationship (e.g., one customer has many orders). If you join the customer table to the order table on CustomerID, the customer’s information will be duplicated for every single order they’ve made. This isn't necessarily an "error" but can inflate metrics like "revenue" if you're not careful. For example, if your campaign budget is listed per Campaign, joining it to every sale from that campaign will duplicate the budget value every time, making your spend look much bigger than it was.

Solution: Be aware of your table relationships. You can troubleshoot by working with aggregated data before the join or by using level-of-detail (LOD) expressions in Tableau to handle calculations properly after the join, ensuring you don't sum the same value multiple times.

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.

Problem: Missing Data (Excessive 'Null' Values)

If you see a lot of nulls, you’ve likely chosen the wrong join type or the wrong join key. An Inner Join on tables without many matching records will result in significant data loss.

Solution: Temporarily switch to a Full Outer Join. This will show you all data from both tables and help you diagnose where the mismatch is occurring. Double-check that your join key (CustomerID vs Customer-ID) is formatted identically in both tables. Even a small difference in naming, capitalization, or data type can cause a join to fail.

Problem: Poor Performance

Joining very large datasets can slow down your workbook significantly, as Tableau has to process the combination on the fly.

Solution 1: Use a Data Extract. Instead of a "live" connection, create a Tableau Data Extract (.hyper file). This is a highly compressed snapshot of your data that Tableau can query much faster than a live database connection. Solution 2: Add Data Source Filters. Before creating your join, consider filtering down your datasets. If you only need data from the last twelve months, apply a filter to remove older data before Tableau has to process the combine operation.

Final Thoughts

Joining datasets in Tableau is a powerful technique that unlocks deeper and more contextual insights by connecting disparate information. Once you understand the four main join types and the practical steps for combining tables, you can move from analyzing siloed metrics to understanding the complex relationships that drive your business.

While mastering joins is a valuable skill for any data analyst, sometimes you just need to connect your different data sources and get an answer fast without having to learn complex join configurations. At Graphed , we automate the painful part of connecting your sales and marketing data. Instead of setting up data sources and defining join types manually, you can simply connect platforms like Shopify, Google Analytics, and Facebook Ads and use natural language to create reports on your combined data, like asking, "Which Facebook campaigns drove the most Shopify sales last month?".

Related Articles