How to Blend Data in Tableau
Combining data from different sources is essential for getting the full picture, but it can feel complicated. Tableau's data blending feature is a powerful and flexible way to put data from Excel spreadsheets, Salesforce, and other databases side-by-side in a single visualization. This article will walk you through exactly what data blending is, when to use it, and how to do it step-by-step.
What Exactly is Data Blending?
Data blending is a method Tableau uses to combine data from different data sources on a single sheet. Think of it as a smart, temporary link between visualizations. Instead of joining data row-by-row at the source level, blending queries each data source independently, aggregates the results, and then combines those aggregated results in the final view.
You can identify data blending in your Tableau workbook by the orange and blue checkmarks on your data sources. The source with the blue checkmark is the primary data source, and the one with the orange checkmark is the secondary data source.
Data Blending vs. Joining: What's the Difference?
This is the most common point of confusion. While both methods combine data, they work in fundamentally different ways.
- Joins combine tables by creating a new, wider virtual table at the row level before any analysis or aggregation happens. This is typically done on the Data Source page in Tableau. A join requires the data from all tables to be in the same source (for example, two tables within the same SQL database or two sheets in the same Excel file).
- Blending happens after the data has been aggregated. It takes the summarized results from the primary data source and then fetches the summarized results from the secondary data source, presenting them together. It works on a sheet-by-sheet basis.
An easy way to think about it: A join is like merging two different address books into one master book before you start counting how many contacts you have in each city. Blending is like counting the contacts in each city from your first address book, then separately counting contacts in each city from your second address book, and finally putting those two counts next to each other in a single list.
When Should You Use Data Blending?
Joins are generally the preferred method when possible, but blending is the perfect solution for specific scenarios.
- Data at Different Levels of Granularity: This is the classic use case. Imagine you have daily sales data in one Excel file and quarterly sales targets in another. A row-level join would be messy because you would either have to duplicate the quarterly target for every single day or aggregate your daily sales up to the quarter. With blending, you can easily display total daily sales aggregated to the quarter next to the quarterly target.
- Connecting Data from Different Sources: This is another major reason to blend. If you want to analyze ad spend from Google Ads against your sales data from Salesforce, you can't join them directly. Data blending allows you to link these distinct sources using a common field, like 'Date' or 'Campaign Name'.
- Working with Large Datasets: Performing joins on huge tables can be very slow and resource-intensive. Because blending queries each data source independently and only combines the aggregated results, it can often be more performant than trying to create a massive joined table.
A Step-by-Step Guide to Data Blending in Tableau
Let's walk through a practical example. Say we have store sales data in one Google Sheet and a separate Google Sheet containing regional sales targets. We want to build a simple view to see how each region's sales performance stacks up against its target.
Our Data:
- Sales Data Sheet: Contains
Date,Region, andSalesdata for individual transactions. - Sales Targets Sheet: Contains
RegionandTargetfor each sales region.
Step 1: Connect to Your First (Primary) Data Source
First, open Tableau and connect to your first data source. In this case, it’s the Google Sheet with our Sales Data.
- Go to the Data Source tab.
- Select Google Drive / Google Sheets and authorize your account.
- Choose the sheet containing your sales data. Tableau will load a preview.
Step 2: Add Your Second (Secondary) Data Source
Without leaving your current workbook, add your second data source.
- Click the "Add" button next to Connections on the Data Source tab, or go to Data > New Data Source.
- Connect to your second Google Sheet, the one containing
Sales Targets.
You’ll now see both data sources listed in the Data pane on an empty worksheet.
Step 3: Define the Linking Field(s)
Now it's time to tell Tableau how these two sources are related. They are linked by the common column, Region.
- Go to a new worksheet.
- Select your
Sales Datasource in the Data pane. It will become the primary source for this sheet, indicated by a blue checkmark. - Select the
Sales Targetssource. Tableau will automatically look for fields with the same name. If it finds one, likeRegion, it will show an orange linking chain icon next to the field in the secondary data source's dimensions. This means the link is active. - If Tableau doesn't find the link automatically (e.g., if one field is named 'Region' and the other is 'Sales Region'), you can define it manually. Go to Data > Edit Blend Relationships and set up the link yourself.
Step 4: Build Your Visualization
This is where the magic happens. The key is to always start building your view with fields from the primary data source.
- First, drag
Regionfrom theSales Data(primary) source onto the Rows shelf. This sets the level of detail for our view. - Next, drag
Salesfrom theSales Datasource onto the Columns shelf. Tableau will automatically aggregate this asSUM(Sales). You now have a bar chart showing total sales by region. - Now, click on the
Sales Targets(secondary) data source in the Data pane. You’ll see it now has an orange checkmark, confirming it's the secondary source. The chain icon next toRegionshould be orange and look 'pressed in,' indicating it's the active linking dimension for the view. - Finally, drag
Targetfrom the secondary source and drop it onto the Columns shelf next toSUM(Sales).
Instantly, you have a visualization that combines aggregated data from two different sources. You can now clearly see actual sales plotted right next to sales targets for each region. You could even create a calculated field to find the variance: SUM([Sales]) - SUM([Sales Targets].[Target]).
Handling Asterisks (*) in Your View
Sometimes when you bring a field over from a secondary source, you might see an asterisk (*) instead of a value. This is Tableau's way of telling you that there are multiple matching values in the secondary source for a single mark in your primary source, and it doesn't know which one to display.
For example, if our Sales Data was granular down to the city level, but our view only showed Region, bringing a city-level dimension from a blended source would cause an issue. To fix this, you need to either add more linking dimensions to create a more specific match or ensure that the level of aggregation in your sheet matches the relationship between your sources.
Best Practices for Data Blending
To keep things running smoothly, follow these best practices:
- Primary Comes First: Always drag dimensions from your primary data source into the view first. This source's dimensions define the final level of detail.
- Lower Granularity as Primary: Whenever possible, use the data source with the more detailed (or "lower") level of granularity as your primary source. In our example, the daily transaction data was primary, and the less granular regional targets were secondary.
- Clean Linking Fields: Ensure the values in your linking fields are consistent. Trim whitespace and check for spelling variations ("USA" vs. "United States") that could break the link.
- Primary Filters Rule: By default, a filter on the primary data source affects the entire view. A filter on a secondary source only filters the data from that source. You can modify this behavior, but it's important to remember an "all-fields" filter is typically based on the primary.
Final Thoughts
Data blending is a fantastic and often necessary skill for any Tableau user. It gives you the flexibility to combine aggregated data from completely different systems when a direct join isn't feasible, allowing you to create richer, more insightful dashboards from all your available information.
Of course, stitching together data from different marketing and sales platforms - whether in Tableau or a spreadsheet - is often the most time-consuming part of reporting. At my company, Graphed , we felt this pain firsthand. That’s why we built a tool that allows you to connect all your data sources like Google Analytics, Shopify, Facebook Ads, and Salesforce just once. From there, you can create real-time dashboards and reports simply by describing what you need in plain English, completely eliminating the manual work of blending data sources together.
Related Articles
What SEO Tools Work with Google Analytics?
Discover which SEO tools integrate seamlessly with Google Analytics to provide a comprehensive view of your site's performance. Optimize your SEO strategy now!
Looker Studio vs Metabase: Which BI Tool Actually Fits Your Team?
Looker Studio and Metabase both help you turn raw data into dashboards, but they take completely different approaches. This guide breaks down where each tool fits, what they are good at, and which one matches your actual workflow.
How to Create a Photo Album in Meta Business Suite
How to create a photo album in Meta Business Suite — step-by-step guide to organizing Facebook and Instagram photos into albums for your business page.