How to Do Cluster Analysis in Tableau
Finding meaningful patterns in your customer data can feel like searching for a needle in a haystack. Cluster analysis is a powerful technique that sorts your data into distinct groups, helping you see the forest for the trees. This guide will walk you through exactly how to perform cluster analysis directly within Tableau, turning complex data into clear customer segments you can act on.
What Exactly is Cluster Analysis?
In simple terms, cluster analysis is a technique that automatically groups similar data points together. Think of it like a smart sorting hat for your data. It looks at the characteristics (or variables) you provide and puts data points that are alike into the same "cluster" while keeping them separate from data points that are different.
It's an example of unsupervised machine learning, which is a fancy way of saying you don't need to tell it what the groups are beforehand. You provide the raw data, and the algorithm finds the natural groupings for you. For example, you could feed it customer purchase data, and it might group your customers into segments like:
- High-Value Regulars: Customers who buy frequently and spend a lot.
- Bargain Hunters: Customers who make infrequent, smaller purchases, often with a deep discount.
- Newbies: New customers with only one or two small purchases.
Suddenly, instead of looking at thousands of individual customers, you have a handful of manageable segments to analyze, market to, and build strategies for.
Why Use Clustering in Tableau?
Tableau's biggest advantage is its visual, interactive approach. Rather than running code or navigating complex statistical software, Tableau makes clustering a drag-and-drop experience. This turns a once-technical process into something accessible to anyone who uses the platform.
Here's what you can achieve with it:
- Customer Segmentation: This is the most common use case. Group customers by behavior like purchase frequency, average order value, sales, or profit to tailor marketing campaigns. Are you targeting your big spenders differently than your infrequent shoppers? Clustering helps you find out who is who.
- Product Grouping: Identify products that are frequently purchased together or have similar sales patterns. This can inform product bundling, inventory management, and store layouts.
- Market Analysis: Segment geographic regions based on performance metrics like sales, growth, and market penetration to identify untapped opportunities or underperforming areas.
- Outlier Detection: Sometimes, a single data point will form its own cluster. This can be an effective way to spot anomalies or outliers - like a transaction with exceptionally high profit or a region with surprisingly low performance - that warrant further investigation.
Getting Your Data Ready for Clustering
Before you jump into the fun part, a little preparation goes a long way. The quality of your clusters depends entirely on the quality and relevance of the data you feed into the model. Here's what to consider.
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.
1. Choose the Right Variables
Your variables (the Measures in Tableau-speak) determine how the clusters are formed. If you're segmenting customers, you'll need measures that describe their behavior. For instance, using Sales and Profit will group customers based on their monetary value.
If you included Quantity and Discount, you would get clusters based on purchasing volume and price sensitivity. Don't be afraid to experiment. The variables you choose are directly tied to the business question you're trying to answer.
2. Mind the Scale
Tableau's clustering algorithm automatically normalizes the data behind the scenes, so you don't have to do it manually. Normalization is the process of adjusting values measured on different scales to a common scale. For example, it prevents a variable like Sales (with values in the thousands) from overpowering a variable like Quantity (with values in the single or double digits). While Tableau handles this, it's good to understand the concept so you know the model isn't biased towards measures with larger absolute values.
3. Build Your Initial View
To run a cluster analysis in Tableau, you need a visualization to apply it to. A scatter plot is the most intuitive and common starting point, especially for two variables. It lets you physically see clumps of dots on the screen, giving you a gut feeling for where the clusters might land.
For your analysis, the lowest level of detail should be what you want to group. If you're clustering customers, your view must have Customer Name or Customer ID on the Detail shelf.
Step-by-Step Guide: Creating Clusters in Tableau
Let's walk through an example using the Sample - Superstore dataset that comes with Tableau. Our goal is to segment customers based on their total Sales and Profit.
Step 1: Create a Scatter Plot
First, we need to create a view that shows each individual customer. A scatter plot is perfect for this.
- Open Tableau and connect to the Sample - Superstore data source.
- Drag Profit to the Rows shelf.
- Drag Sales to the Columns shelf.
- Drag Customer Name to the Detail shelf on the Marks card.
You should now have a scatter plot where each dot represents a single customer. You might already notice some natural groupings, but let's use Tableau to make it official.
Step 2: Find and Drag the Cluster Function
Now, we'll apply the clustering model.
- Go to the Analytics pane (it's a tab next to the Data pane).
- Under the Model section, find Cluster.
- Click and drag Cluster onto the canvas. A tooltip will appear asking where to drop it. Just drop it directly on the chart area that says Add Clusters.
As soon as you do this, a "Clusters" dialog box will pop up, and Tableau will immediately add colored clusters to your view.
Step 3: Configure the Clusters
The dialog box is where you control the analysis. You have two main inputs:
- Variables: Here, you define which measures the algorithm should use. By default, Tableau includes the Measures currently in your view (Profit and Sales). You can drag other measures from the data pane into this box to include them in the calculation. For example, you could add Quantity. But for now, we'll stick with Sales and Profit.
- Number of Clusters: You can either let Tableau determine the number of clusters automatically or manually enter a number. Starting with "Automatic" is a good approach to get a baseline. You can then experiment with different numbers to see if you uncover more insightful groups. Let's try setting it to 4.
Once you close the dialog, Tableau does its magic.
Step 4: Visualize and Use the Clusters
Tableau automatically creates a new field in your side panel called Clusters and drops it onto the Color shelf. Your scatter plot is now colored according to the cluster each customer belongs to. Voila! You have segmented your customers.
You’ll now clearly see four different groups defined by their combination of profitability and sales volume. For a cleaner look, you can also drag the new Clusters field (from the Marks card or the side panel) to the Shape shelf to give each cluster a distinct shape.
Notice that in the Data pane, under Sets, there is now a group called "Clusters." You can rename this group to something more descriptive like "Customer Segments (Sales, Profit)."
Interpreting and Using Your Clusters
Creating the clusters is only half the battle. Now you need to understand what they represent and put them to work.
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.
Describe the Clusters
Tableau provides a handy feature to help with this. Right-click the Clusters field on the Marks card and choose Describe Clusters....
This opens a summary statistics window profiling each cluster. It shows the number of items (customers) in each cluster and the average value for each variable used in the model (Sales and Profit).
Based on this summary, you can create personas for your segments:
- Cluster 1 (e.g., Blue): High Average Sales, High Average Profit. These are your VIPs.
- Cluster 2 (e.g., Orange): Low Average Sales, Low Average Profit. These are your Occasional Shoppers.
- Cluster 3 (e.g., Red): High Sales, Negative Profit. These are your Problem Customers or Discount Chasers - they buy a lot, but are unprofitable, perhaps due to high returns or deep discounts.
- Cluster 4 (e.g., Green): Moderate Sales, Moderate Profit. Your Core Customers.
Use Clusters in Other Visualizations
The real power of clustering is using your newfound segments elsewhere in your dashboard. Because Tableau saves the cluster group as a field, you can use it just like any other dimension.
For example, you can create a new worksheet with a map showing Sales by State. Now, drag your "Customer Segments" field to the Color shelf on the map's Marks card. This will instantly show you the geographical distribution of your customer segments. Are your VIPs concentrated on the West Coast? Are your unprofitable customers mostly coming from Texas? These are the kinds of powerful, actionable insights you can generate in seconds.
Final Thoughts
Cluster analysis is an incredibly effective technique for uncovering hidden structures within your data, and Tableau makes this capability remarkably accessible. By following these steps, you can move from a wall of numbers to well-defined customer personas, product groups, or market segments that can directly inform your business strategy.
Experimenting with different variables and numbers of groups is a key part of the process, but the ability to rapidly test these ideas visually allows for a level of analytical speed that was once impossible. And while Tableau makes clustering easy, we know that getting all your marketing and sales data connected and ready for analysis can still be a major roadblock. We built Graphed to solve this very problem by connecting to all your platforms and enabling you to start your analysis by just asking questions. Instead of manually building charts, you can simply ask, "group my Shopify customers by total sales and order count," and get started from there.
Related Articles
Facebook Ads For Personal Trainers: The Complete 2026 Strategy Guide
Learn how to effectively use Facebook ads for personal trainers in 2026. This comprehensive guide covers targeting strategies, ad creative, budgeting, and optimization techniques to help you grow your training business.
Facebook Ads for HVAC Companies: The Complete 2026 Strategy Guide
Learn how to run high-converting Facebook ads for HVAC companies in 2026. This guide covers targeting, creative strategies, and proven campaigns that drive real leads.
Facebook Ads for Florists: The Complete 2026 Strategy Guide
Learn proven Facebook advertising strategies for florists in 2026. Target the right audience, create compelling visuals, and optimize your ad budget for maximum ROI.