How to Join Two CSV Files in Tableau
Ever found yourself looking at two different spreadsheets, knowing the story you need to tell is split between them? For example, you have customer contact information in one CSV and their purchase history in another. To understand your business fully, that data needs to be in one place. This article will walk you through exactly how to join two CSV files directly in Tableau, turning separate data points into powerful, connected insights.
First Things First: Getting Your Data Ready to Join
Before you even open Tableau, spending a few minutes preparing your CSV files can save you a lot of time and headaches. A successful join depends entirely on having clean, consistent data, especially in the column you plan to use to connect the two files.
Find Your Common Column (The "Join Key")
To join two tables, they must have at least one column in common. This shared column is often called a "join key" or a "common identifier." Think of it as the shared piece of information that links a row in your first file to a row in your second file.
Here are some examples of common join keys:
- Customer ID: One file has customer details, the other has their orders.
- Email Address: One file has marketing campaign interactions, the other has CRM data.
- Product SKU: One file has inventory data, while another has sales transaction details.
- Order ID: One file has order information, and the other has the corresponding shipping status.
Open both of your CSV files and identify this common column. If you don't have one, you might need to do some work in a spreadsheet program like Excel or Google Sheets to create one before bringing the data into Tableau.
Check for Consistency in Your Join Key
Tableau needs the values in your join key column to match exactly. A small difference can prevent the join from working correctly.
- Column Headers: Double-check that your join key column has a clear and consistent header in both files (e.g.,
CustomerIDin both files, notCustomerIDin one andCustomer_IDin the other). While Tableau can often handle different names, using the same name is good practice. - Formatting: Look for inconsistencies like "Acme Co" in one file and "Acme Company" in the other, or postal codes like
95054vs.95054-3453. - Hidden Spaces: A common culprit is leading or trailing spaces. " CA " is not the same as "CA". Use the TRIM function in Excel or Google Sheets to remove these beforehand.
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.
A Step-by-Step Guide to Joining CSVs in Tableau
Once your files are prepped and ready, it’s time to head into Tableau. The process is quite direct and visual, making it feel less intimidating than writing code.
Step 1: Connect to Your First Report
Start by opening Tableau and connecting to your first data source.
- On the start page, under the Connect pane, select Text File.
- In the file explorer that pops up, navigate to and select your first CSV file. Click Open.
- Tableau will now take you to the Data Source page, showing a preview of the data from your first file in the canvas.
Step 2: Add Your Second Report
Next, you’ll add your second CSV file to the same data source connection.
- In the left pane, under Connections, click the Add button (it looks like a cylinder with a plus sign).
- Again, select Text File.
- Locate and open your second CSV file.
You'll now see both of your file names listed in the left pane of the Data Source page.
Step 3: Create the Join Relationship
This is where the magic happens. A "join" in Tableau is built by creating a visual relationship between your data tables. Simply drag your second file from the left pane onto the canvas, to the right of your first file. Tableau will automatically try to create a join relationship, represented by a connecting line often called a "noodle."
Step 4: Configure the Join Clause and Select Your Join Type
Tableau will try to guess which columns to use for the join. Sometimes it's right, and sometimes you need to tell it specifically which columns to use.
- Click on the join icon (the overlapping circles in the noodle). This opens the join configuration dialog box.
- Under "Join Clause," define what makes rows from each file match up.
- Next, you need to select the right Join Type. This is a very important step that tells Tableau how to handle rows that have matches versus those that don’t.
Below the file previews, you’ll see the combined data. You can now go to a worksheet and start building visualizations with fields from both of your original CSV files!
What Kind of Join Should I Use?
Choosing the correct join type is fundamental to getting accurate results. Let’s imagine we have a Customers.csv file and an Orders.csv file, joined on CustomerID.
Inner Join (The Default)
An Inner Join returns only the matching rows from both tables. Think of it as the strict intersection of your two files.
- What it does: You'll only see customers who have placed an order. Any customer in your
Customers.csvwho hasn’t bought anything will be excluded. Likewise, any order with aCustomerIDthat doesn't exist in your customer file will also be excluded. - When to use it: When you only care about data where a relationship exists in both files, like analyzing sales performance for your known customer base.
Left Join
A Left Join returns all rows from the left table and the matched rows from the right table. If there’s no match for a row from the left table, the columns from the right table will show as "Null."
- What it does: Using our example, this would show you all your customers, regardless of whether they have made a purchase. The order-related fields will simply be empty (null) for non-purchasing customers.
- When to use it: This is arguably the most common and useful type of join. It’s perfect for questions like, "Show me all my customers and which ones have purchased," or to find customers who have not completed a certain action.
Right Join
This is the mirror opposite of a Left Join. It returns all rows from the right table and adds matched information from the left.
- What it does: In our example, it would return all orders, even if the customer information for that order is missing from the
Customers.csvfile (maybe a guest checkout). - When to use it: It's less common than a Left Join but can be useful for data auditing, like finding orders that aren't tied to a known customer account.
Full Outer Join
A Full Outer Join returns all rows from both tables. If there's a match, the data is combined. If not, Tableau includes the row from each table and fills in the missing columns with null values.
- What it does: You get every single customer and every single order on the list, whether they are connected or not.
- When to use it: Most often used for data validation to see all records from both systems and identify any mismatches or orphan records on either side.
Solving Common Problems with Tableau Joins
Sometimes, even with careful preparation, you run into issues. Here are a couple of common ones and how to fix them.
"My Data Is Massively Duplicated!"
The problem: After joining an Orders file to a Customers file, you notice that your row count exploded, and revenue figures seem way too high.
The solution: This usually happens with a one-to-many relationship (one customer has many orders). The join is correctly creating a separate row for each unique customer-order combination. Your customer's information is being duplicated for each of their orders. This isn’t an error, it's how database joins work! When you build a visualization, don’t drag the raw Sales measure onto the canvas. Instead, use an aggregation like SUM(Sales) or AVG(Sales). Tableau will then calculate the total or average correctly at the customer level.
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.
"I’m Seeing Way More Nulls Than Expected."
The problem: You performed a Left Join to see all your customers and their orders, but a customer you know has placed orders is showing null values for all the order fields.
The solution: The issue is almost always a mismatch in your join key. Go back and check the values for that specific customer in both of your original CSV files. There’s likely a subtle difference — a stray space ('1011 '), a data type mismatch (1011 vs. '1011'), or an inconsistent value ('chrisperez' vs. 'chris_perez') — that’s preventing the match from happening.
Final Thoughts
Joining data from different CSV files is a foundational skill in Tableau that opens up a much deeper level of analysis. By combining separate datasets, you can move from looking at isolated metrics to understanding the full story your data has to tell. Always remember to start with clean join keys, choose the right join type for your question, and you'll be well on your way.
While joining files within Tableau is manageable, the process of manually exporting CSVs from different platforms (like your ads manager, CRM, and storefront) and piecing them together can be slow and repetitive. We built Graphed to remove this friction entirely. Instead of dealing with CSVs and join configurations, we connect directly to your data sources in one click. From there, you can just ask in plain English - "show me revenue by campaign from Facebook Ads and Shopify for the last 30 days" - and Graphed builds a live, interactive dashboard for you in seconds, automatically handling the joins in the background. It allows you to spend your time exploring insights, not wrangling data.
Related Articles
How to Create Facebook Ads API for Claude Code
Create a Meta Marketing API access token that never expires, using a system user, so Claude Code can pull Facebook ad reports and manage campaigns.
ClickHouse vs Postgres: When to Switch to Columnar
Comparing ClickHouse vs PostgreSQL means matching storage architecture to workload. Row storage wins for transactions. Columnar wins for scan-heavy analytics.
Google Ads for Orthodontists: Get More Booked Consults
Most orthodontic Google Ads campaigns waste money on low-intent searches. The problem is structure, not the platform.