What Types of Data Does a Scatter Plot Require in Tableau?
Scatter plots are one of the most effective ways to see the relationship between two different variables. Instead of getting a simple summary number, you get to see how individual data points behave, making it easy to spot trends, outliers, and correlations at a glance. But before you can build one in Tableau, you need to provide it with the right kind of data. This article will walk you through exactly what data types a scatter plot requires and how to use dimensions to make your analysis even more powerful.
The Core Components of a Tableau Scatter Plot
At its heart, a scatter plot (also known as a scattergram or scatter chart) maps data points along a horizontal (X) axis and a vertical (Y) axis. The goal is to see if there's a relationship between the two values you've chosen. For example, do sales increase when ad spend increases? Does profit go down as the discount rate goes up?
To build this in Tableau, you need two fundamental ingredients:
A quantitative measure for the X-axis. This will be placed on the Columns shelf.
A quantitative measure for the Y-axis. This will be placed on the Rows shelf.
That's the absolute minimum. Both axes must represent numerical data that can be aggregated, which Tableau calls "measures." Without two measures, you can't create the continuous axes needed to plot the points.
The Role of Measures: Your X and Y Axes
In Tableau, "measures" are fields that contain quantitative, numerical values. Think of things you can count, average, or sum up, such as Sales, Profit, Temperature, Age, or Quantity. When you connect a data source, Tableau automatically identifies these fields and places them in the "Measures" section of the data pane, usually marking them with a green '#' icon.
Let's use a common example. Imagine you want to see the relationship between Sales and Profit from the Tableau Sample - Superstore dataset. Here’s what happens:
You drag the Sales measure to the Columns shelf.
You drag the Profit measure to the Rows shelf.
The result? You'll see a chart with a single mark. This might be confusing at first, but it makes perfect sense. By default, Tableau has aggregated all your data. That single point represents the SUM(Sales) and SUM(Profit) for your entire dataset. It's a valid visualization, but it's not a scatter plot yet because there's nothing to "scatter."
Bringing Your Scatter Plot to Life with Dimensions
To transform that single point into a true scatter plot, you need to break down the data into smaller pieces. This is where "dimensions" come in. Dimensions are fields that contain qualitative, categorical data. They are typically descriptive attributes like Customer Name, Product Category, Region, or Order ID. In Tableau, they appear in the "Dimensions" section and are usually marked blue.
Dimensions give your visualization context by slicing your measures. To create the "scatter" of points, you add a dimension to the Detail card on the Marks shelf.
Continuing our Sales vs. Profit example, let's add the Customer Name dimension to the Detail card:
X-Axis: SUM(Sales)
Y-Axis: SUM(Profit)
Detail: Customer Name
Instantly, the single point explodes into hundreds of individual marks. Each mark now represents a unique customer. The position of each mark is determined by that customer's total sales (along the X-axis) and total profit (along the Y-axis). Now you can really start analyzing things! You can see high-value customers in the top right, unprofitable customers in the bottom right, and everyone else scattered in between.
The dimension you choose for the detail level is important. If you used Product Sub-Category instead of Customer Name, you would see far fewer points - one for each sub-category - which might give you a higher-level view of product performance.
Adding Context with Color, Size, and Shape
Once you have your basic scatter plot, you can layer on more information using other options on the Marks card. This allows you to visualize more than just two variables at once.
Using Color to Group Data
Dragging a dimension to the Color card is a great way to group your data points. For instance, if you drag the Region dimension onto Color, all the points belonging to the "West" region will be one color, "East" another, and so on. This can immediately reveal regional trends. Do customers in one region tend to be more profitable than another?
You can also use a measure on the color shelf. If you dropped the Discount measure on Color, the points would show a color gradient, with high-discount customers being darker and low-discount customers being lighter. This can quickly highlight whether high discounts are correlated with low profitability.
Using Size to Add Another Measure
The Size card allows you to encode another measure into your visualization. If you drag the Quantity measure to Size, the marks will change in size based on the total quantity of items each customer ordered. Larger marks represent customers who ordered more items. This helps you understand a third quantitative variable without adding another axis.
Using Shape for Distinct Categories
If you have a dimension with only a few distinct members (usually less than five), the Shape card can be useful. For example, dragging Ship Mode to Shape will represent "Standard Class," "Second Class," and "First Class" with different shapes (e.g., circles, squares, and plus signs). This works well for quickly distinguishing between a few key categories.
Example Walkthrough: Analyzing Product Performance
Let’s put all the pieces together with a step-by-step example using the Sample - Superstore dataset.
Our Goal: See the relationship between sales and profit for each product sub-category, grouped by the main product category and sized by the average discount.
Start with the Measures: Drag Sales to the Columns shelf and Profit to the Rows shelf. You'll see one point.
Add the Level of Detail: Drag the Product Sub-Category dimension to the Detail card on the Marks shelf. Now you have a point for each sub-category (e.g., "Phones," "Chairs," "Tables").
Group with Color: Drag the Category dimension to the Color card. The sub-categories are now colored based on whether they belong to "Technology," "Furniture," or "Office Supplies."
Encode Size: Drag the Discount measure to the Size card. You'll probably want to right-click the pill and change its aggregation from SUM to AVG (Average) to see the average discount. Now, sub-categories with higher average discounts will have larger marks.
From this single chart, you can quickly find powerful insights. You’ll likely see the infamous "Tables" sub-category in the Furniture group: it has high sales but a large, negative profit. And since its mark is one of the largest, you can infer that high average discounts are likely dragging down its profitability.
Tips for Effective Scatter Plots in Tableau
Building a scatter plot is straightforward once you know the rules, but a few simple tips can help you avoid common mistakes and get more out of your analysis.
Don't Put Dimensions on the Axes: A scatter plot requires continuous axes. If you place a dimension (like Region) on the Columns or Rows shelf, Tableau will create headers and labels for each region, not a continuous numerical scale. Keep measures on the axes.
Always Add Detail: Don't forget that a scatter plot is meaningless with only one point. The key is in the "scatter," which you can only get by adding a dimension to the Detail card.
Add a Trend Line: In the Analytics pane, you can drag a Trend Line onto your plot to automatically show the correlation in your data. It will draw a line that best fits the data and show you the R-squared and p-value, giving you a statistical measure of the relationship strength.
Customize Your Tooltip: By default, the tooltip shows the data used in the view. You can edit the tooltip to include additional information, like Customer Name or Quantity, to give rich context when someone hovers over a mark without cluttering the visualization itself.
Final Thoughts
To recap, building a scatter plot in Tableau requires two numerical measures on your Columns and Rows axes and at least one qualitative dimension on the Detail Mark to give your data points something to scatter across. From there, you can add even more layers of insight by using other dimensions and measures on the Color, Size, and Shape cards to tell a richer story.
Figuring out which field goes where can sometimes feel like a puzzle, especially when you're just trying to get a quick answer. Instead of manually dragging and dropping fields, we built Graphed because we believe anyone should get insights by simply asking a question. For example, you can tell Graphed, "show me a scatter plot of sales vs. profit for each customer, and color it by region," and our platform will build the fully interactive visualization for you instantly. It connects directly to your data sources and translates your questions into the charts and reports you need, helping you get directly to the analysis without the setup time.