How to Make a Comparison Chart in Tableau
Comparing different sets of data is the foundation of modern business analytics. It’s how you find out which marketing campaign is actually working, what products are flying off the shelves, or which sales region is lagging behind. This tutorial walks you through how to create several powerful comparison charts in Tableau, using clear, step-by-step instructions along the way.
Why Does Comparing Data Matter?
Before jumping into the "how," it helps to understand the "why." Comparison charts turn raw data into actionable stories. They help you answer critical business questions like:
Performance vs. Target: Are our sales reps hitting their quarterly goals?
Year-over-Year Growth: How does our revenue this year compare to last year?
Category Analysis: Which of our product categories generates the most profit?
A/B Testing: Which landing page design drove more conversions?
By visualizing these comparisons, patterns and outliers that might be hidden in a spreadsheet instantly become clear. You stop guessing and start making decisions based on evidence.
Getting Started: Your Data Setup in Tableau
For this tutorial, we will use the Sample - Superstore dataset that comes pre-packaged with every copy of Tableau Desktop. It’s full of sales data, perfect for creating meaningful comparisons right out of the box.
When you open Tableau, on the left side under "Saved Data Sources," click on Sample - Superstore to load it. Once loaded, click on "Sheet 1" at the bottom left to enter the worksheet interface where the magic happens.In the "Data" pane on the left, you'll see your data is divided into Dimensions (qualitative data like 'Category' or 'Order Date') and Measures (quantitative, numerical data like 'Sales' or 'Profit'). Understanding this distinction is fundamental to building visualizations in Tableau.
1. The Classic: Bar Chart for Direct Comparison
The bar chart is the workhorse of data visualization for a reason: it's incredibly effective for comparing categories side-by-side. Let's compare the total sales across different product categories.
Step-by-Step Instructions:
Drag and Drop Your Dimension: From the "Data" pane, find the
Categorydimension. Click and drag it to the Columns shelf at the top of the workspace. You will see three column headers appear: 'Furniture', 'Office Supplies', and 'Technology'.Drag and Drop Your Measure: Now find the
Salesmeasure. Click and drag it to the Rows shelf. Tableau will immediately generate a vertical bar chart, with each bar representing the total sales for that category.Add Color and Labels for Clarity: To make the chart more readable, you can add color and data labels.
Drag the
Categorydimension again, but this time drop it onto the Color card in the Marks pane. Each bar will now have a distinct color.Drag the
Salesmeasure onto the Label card in the Marks pane. The exact sales total will now appear on top of each bar.
Sort for Quicker Insights: It's best practice to sort bar charts. Hover over the "Sales" axis label until a small sort icon appears, or use the quick sort buttons in the toolbar at the top. Sorting from highest to lowest instantly shows you that "Technology" is the top-selling category.
You’ve just created a simple but highly effective comparison chart. It clearly communicates which product categories are your top performers in terms of sales.
2. The Side-by-Side Bar Chart for Deeper Analysis
What if you want to add another layer of comparison? For instance, how do the sales for each category compare across different years? A side-by-side (or grouped) bar chart is perfect for this.
Step-by-Step Instructions:
Start with the Basic Bar Chart: Follow the first two steps from the previous section to create a bar chart showing Sales by Category.
Add a Second Dimension: Find the
Order Datedimension in the "Data" pane. Drag it to the Columns shelf and place it right next to theCategorypill. By default, Tableau will likely showYEAR(Order Date). If not, right-click the "Order Date" pill and select "Year".Arrange to Group the Bars: Right now, you might have a separate chart for each year. To group them, simply drag the
YEAR(Order Date)pill from the Columns shelf onto the Color card in the Marks pane. (Remove theCategorypill from the Color card if it's still there). Instantly, you'll have grouped bars showing the sales performance for each category, broken down by year.Refine the View: You can resize the bars and adjust the view to ensure everything is legible. Try clicking the "Swap Rows and Columns" button in the toolbar to see if you prefer a horizontal layout.
This chart gives you much richer information. You can now see not only which category performs best overall but also how sales for each category have trended over the years.
3. The Line Chart to Compare Trends Over Time
When your primary comparison is over a period of time, a line chart is often the best choice. It’s excellent for visualizing trends, seasonality, and growth patterns. Let's compare the monthly sales from different regions.
Step-by-Step Instructions:
Set Up the Time Axis: Drag the
Order Datedimension to the Columns shelf. By default, it will show the year. Right-click theYEAR(Order Date)pill, hover over the second "Month" option (not the discrete 'MONTH(May)'). This makes the time axis continuous, which is essential for a proper trend line.Add Your Measure: Drag the
Salesmeasure to the Rows shelf. You will now see a single line chart showing total sales over time.Split the Line for Comparison: This is where the comparison happens. Drag the
Regiondimension to the Color card in the Marks pane. Tableau instantly creates four separate, color-coded lines — one for each region.Customize and Annotate: You might see a lot of fluctuation. This is a great opportunity to add annotations. For example, right-click on a peak in the line, and select "Annotate" > "Point" to add a note explaining why a sales spike occurred (e.g., "Annual holiday sale").
You now have a clear view of which regions are performing the best over time and can spot interesting patterns, like the consistent fourth-quarter sales jump in the West region.
4. The Bullet Chart to Compare Performance Against a Target
A bullet chart is a fantastic way to compare an actual value against a target or benchmark. While the Superstore dataset doesn't have a "Sales Target" field, we can use a reference line to achieve a similar, powerful comparison.
Step-by-Step Instructions:
Create a Base Bar Chart: Let’s compare sales performance for each
Sub-Category. DragSub-Categoryto the Rows shelf andSalesto the Columns shelf. Sort descending.Add a Reference Line: Switch to the Analytics pane (next to the "Data" pane) on the left sidebar. From the options, find Average Line.
Drag and Drop onto the View: Click and drag "Average Line" and hover over your chart. Boxes will appear allowing you to add the line to the entire Table, Pane, or Cell. Drop it onto Table. This adds a vertical line showing the average sales across all sub-categories.
Interpret the Chart: You've instantly created a comparison visual. All the bars extending past the line are above-average performers, while those falling short are below average. The bars for "Phones" and "Chairs" will clearly stand out as high-performers, while items like "Fasteners" and "Labels" are well below the average.
This is an easy yet powerful way to gauge performance relative to a benchmark. If you had an actual target field in your data, you could place that on the Detail shelf and then create a reference line based on that specific measure, turning this into a true bullet chart.
5. The Scatter Plot to Reveal Relationships
Sometimes you need to compare the relationship between two different measures. A scatter plot is perfect for this. Is there a connection between the amount of sales and the profit for different products?
Step-by-Step Instructions:
Choose Your Two Measures: Drag the
Salesmeasure to the Columns shelf. Then drag theProfitmeasure to the Rows shelf. You'll see one single dot in your view, representing the sum total of all sales and profit.Add a Dimension for Detail: This single mark isn't useful for comparison. To get more detail, drag a dimension like
Sub-Categoryonto the Detail card in the Marks pane. Now each mark represents a different sub-category.Use Color for Another Layer of Insight: To make it easier to read and add more context, drag
CategoryorRegionto the Color card. Each mark will now be colored based on its group.Analyze the Quadrants: A scatter plot like this naturally creates four quadrants.
Top-Right: High Profit, High Sales (Your stars, like "Copiers")
Top-Left: High Profit, Low Sales (Niche opportunities)
Bottom-Right: Low Profit, High Sales (Problem children, like "Tables")
Bottom-Left: Low Profit, Low Sales (Areas to divest or re-evaluate)
The infamous "Tables" sub-category in the Superstore dataset appears in the bottom-right quadrant, showing that despite high sales, it is a significant money-loser for the company — an insight that's impossible to see without a visual comparison like this.
Final Thoughts
Tableau offers a whole universe of tools for comparing data, from straightforward bar charts to insightful scatter plots. By choosing the right chart type for your specific question, you can quickly move from looking at numbers to understanding what they actually mean for your business.
Of course, we know that there’s a learning curve to tools like Tableau. We built Graphed because we believe getting insights from your data shouldn't require mastering complex software. Instead of clicking and dragging, you can just connect your data sources and ask questions in plain English like, "Show me a chart comparing sales by category for the last two years," and get a live, interactive dashboard back in seconds.