How to Show Totals on Stacked Bar Chart in Tableau

Cody Schneider7 min read

Creating a beautiful stacked bar chart in Tableau is a great first step, but it often leaves your audience asking one key question: "What's the total for each bar?" While stacked bars are fantastic for showing part-to-whole relationships, they make it difficult to compare the overall totals at a glance. This guide will walk you through the clear, step-by-step methods to add those essential grand totals right on top of your bars, making your visualizations instantly more readable and impactful.

Why Total Labels Matter on a Stacked Bar Chart

Imagine you've built a chart showing quarterly sales, with each bar stacked by product category. You can easily see that, say, 'Technology' made up a larger portion of sales in Q4 than in Q1. However, you can't easily answer which quarter had the highest overall sales. Was the smaller 'Technology' slice in Q1 part of a much smaller total, or was the Q4 total just slightly larger? Eyeballing the top of the bars is imprecise and prone to error.

Adding a total label at the top of each bar removes all ambiguity. It provides your audience with two key layers of information in one clean visual:

  • The Composition: The colored segments of the stack show the breakdown.
  • The Total: The label on top provides the complete value for easy comparison.

This simple addition transforms your chart from a good visualization into a great one that tells a complete story without forcing your viewers to do mental guesswork.

Method 1: The Quickest Way Using a Reference Line

Using a reference line is the most common and straightforward method to add totals to your stacked bars. It’s clean, efficient, and built right into Tableau's analytics features. Let's start by building a basic chart first.

Step 1: Create a Basic Stacked Bar Chart

To demonstrate, we'll use the "Sample - Superstore" dataset that comes with Tableau. If you already have your chart built, you can skip to the next step.

  1. Open Tableau and connect to the "Sample - Superstore" data source.
  2. Drag Order Date to the Columns shelf. Right-click the blue YEAR(Order Date) pill and change it to QUARTER(Order Date). This will give us a bar for each quarter.
  3. Drag Sales to the Rows shelf. Tableau will create a bar chart showing total sales per quarter.
  4. To create the "stack," drag Region to the Color card under Marks.

You should now have a stacked bar chart showing total sales for each quarter, with the colors representing the different regions. Notice how you can't easily tell which quarter had the highest sales without hovering over each one.

Step 2: Add and Configure the Reference Line

Now, let’s add the totals. Many people first try dragging SUM(Sales) to the Label card, but this adds a label to every segment of the bar, creating a cluttered mess. The trick is to use a reference line instead.

  1. Navigate to the Analytics pane, located to the right of the Data pane on the left sidebar.
  2. Under the Custom section, click and drag Reference Line onto your chart.
  3. As you drag it over, Tableau will give you options to drop it. Hover over the chart canvas until a box appears that says Add a Reference Line. Drop the line onto the Pane option. (Choosing Pane applies a separate line and calculation to each bar in the view, which is what we need. Table would apply one line across the entire chart. Cell would apply it to each colored segment.)
  4. A configuration box will pop up. This is where you'll set up your total label.
  5. Click OK.

Voila! You should now see a clean total neatly positioned at the top of each stacked bar. The final chart elegantly communicates both the components and the grand total for each quarter.

Method 2: The Flexible Way Using a Dual-Axis Chart

The reference line method is fast and effective, but it offers limited options for label formatting. If you want more control over the label's position, font, or color, creating a dual-axis chart is a fantastic alternative. It’s a bit more involved, but it unlocks complete formatting freedom.

Step 1: Create a Second Axis for the Labels

Starting with the same basic stacked bar chart from above:

  1. Drag the Sales pill from the Measures pane and drop it onto the Rows shelf again, right next to the existing SUM(Sales) pill. This will create a duplicate of your stacked bar chart.
  2. Now, look at your Marks cards. You should see three: All, SUM(Sales), and SUM(Sales) (2). We will be working with the second sales card SUM(Sales) (2).
  3. On the SUM(Sales) (2) Marks card, click the chart type dropdown and change it from Automatic (Bar) to Gantt Bar. The second chart will transform into thin lines.

Step 2: Combine Charts and Add Labels

Now, let's merge these two charts and turn our hidden Gantt Bar marks into labels.

  1. On the Rows shelf, right-click the second SUM(Sales) pill and select Dual Axis from the menu. This will overlay the Gantt Bar chart on top of your stacked bars.
  2. Next, we need the axes to match. Right-click the right-side axis (for the Gantt marks) and select Synchronize Axis.
  3. Now, back on the SUM(Sales) (2) Marks card, drag the Sales measure onto the Label card. Totals will now appear on your chart.
  4. Finally, to make the Gantt marks invisible, go to the Color card on the SUM(Sales) (2) Marks shelf and drag the opacity slider all the way down to 0%. The floating lines will disappear, leaving only the labels.
  5. For a final cleanup step, right-click the right-side axis again and uncheck Show Header to hide the redundant axis.

You’ve achieved the same result as the reference line method, but now your labels are completely independent. You can format the font, size, and color of just the totals using the Label card on the SUM(Sales) (2) marks, without affecting any other part of your chart.

Fine-Tuning Your Chart

Whether you used a reference line or a dual-axis, a few final formatting touches can take your chart from good to great.

  • Number Formatting: Make your totals easy to read. Right-click the SUM(Sales) measure in the Data pane, go to Default Properties -> Number Format…, and set it to Currency (Custom) with zero decimals. This will apply a clean "$467K" format chart-wide.
  • Label Readability: If your total labels are feeling a bit cramped against the top of the bars, you can give them some more distance. With the dual-axis method, you have fine-grained control over alignment in the Label card options. For reference lines, formatting your labels 'above' the line will also give some more room.
  • Be Mindful of Clutter: You can have both segment labels and total labels, but it rarely works well. Unless absolutely necessary, favor showing either one or the other - and the total label adds more context in most use cases. The main goal is always clarity.

Final Thoughts

Adding total labels to stacked bar charts in Tableau is a fundamental skill that significantly boosts the clarity of your data storytelling. Both the Reference Line method and the Dual-Axis approach are excellent for achieving this, offering a trade-off between speed and customization so you can use either one depending on your situation.

Having to learn these multi-step processes for common charting tasks is exactly why we built Graphed. We believe you should be able to get answers from your data without hunting through configuration menus and formatting panes. We made things simple so instead of clicking, dragging, and formatting, you can just ask a question in plain English. With our tool, you would simply type, "Show total sales by quarter and region as a stacked bar chart and display the totals on top of each bar" and the right chart is instantly created for you, connected to your live data.

Related Articles

How to Connect Facebook to Google Data Studio: The Complete Guide for 2026

Connecting Facebook Ads to Google Data Studio (now called Looker Studio) has become essential for digital marketers who want to create comprehensive, visually appealing reports that go beyond the basic analytics provided by Facebook's native Ads Manager. If you're struggling with fragmented reporting across multiple platforms or spending too much time manually exporting data, this guide will show you exactly how to streamline your Facebook advertising analytics.

Appsflyer vs Mixpanel​: Complete 2026 Comparison Guide

The difference between AppsFlyer and Mixpanel isn't just about features—it's about understanding two fundamentally different approaches to data that can make or break your growth strategy. One tracks how users find you, the other reveals what they do once they arrive. Most companies need insights from both worlds, but knowing where to start can save you months of implementation headaches and thousands in wasted budget.