How to Show Total in Tableau Bar Chart
Adding a total to your Tableau bar chart is a frequent request and for good reason - it provides crucial context at a glance. Instead of leaving it to your audience to mentally add up the numbers, you can present the full picture in a single, clear visualization. This guide will walk you through several effective methods to show totals in a Tableau bar chart, from the quick and easy to the more customized approach for maximum impact.
Why Show Totals on a Bar Chart?
Before jumping into the "how," it’s useful to understand the "why." Displaying a total directly on a bar chart serves a few key purposes:
- Provides Context: A bar chart is great for comparing the values of different categories. Adding a total shows the relationship of each part to the whole, answering questions like, "This category accounts for how much of our total revenue?"
- Improves Readability: It saves the viewer from having to scan a tooltip for each bar and do the math themselves. This makes your dashboard more user-friendly and your insights easier to grasp.
- Highlights Performance: Seeing individual bar values alongside the total can quickly highlight top performers and their significance to the overall result.
Setting Up Your Basic Bar Chart
To demonstrate the different methods, we'll start with a simple bar chart using the "Sample - Superstore" dataset that comes with Tableau. If you want to follow along, you can build this chart in under a minute.
- Connect to the Sample - Superstore data source.
- From the Data pane, drag the Category dimension to the Columns shelf.
- Drag the Sales measure to the Rows shelf.
You now have a basic bar chart showing sales for three categories: Furniture, Office Supplies, and Technology. Now, let's add the total.
Method 1: Using the Built-in 'Grand Totals' Feature
The fastest way to add a total to your view is with Tableau's built-in Grand Totals feature. This is a great choice when you need a quick sum without much custom formatting.
Step-by-Step Instructions
- With your bar chart created, navigate to the top menu bar.
- Click on Analysis.
- In the dropdown menu, hover over Totals.
- Select Show Column Grand Totals.
Just like that, Tableau adds a new "Grand Total" bar to your chart, which represents the sum of all categories. By default, it appears at the end of your chart.
Pros: Extremely fast and easy - just three clicks.
Cons: The total bar is treated like another category, which can sometimes skew the Y-axis and make the individual bars look smaller. The visual format isn't always ideal, as some analysts prefer to show the total as supporting information rather than a primary bar.
Method 2: Using a Reference Line from the Analytics Pane
A reference line is a more elegant and versatile way to show a total. It overlays a line across your chart at the total value, providing clear context without adding another bar to your visualization.
Step-by-Step Instructions
- In the sidebar on the left, switch from the Data pane to the Analytics pane.
- Under the "Summarize" section, drag Total and hover it over your chart.
- Tableau will give you several drop targets: Table, Pane, and Cell. For a simple bar chart like ours, Table is the correct choice to calculate the sum for all visible categories. Drop it there.
Once you drop it, a reference line and its corresponding label will appear on your chart, stretching across the plot at the grand total sales value.
Customizing Your Reference Line
The default reference line is functional, but you can format it to make your chart clearer.
- Right-click on the reference line or its label and select Edit... or Format....
- In the Edit Line dialog, change the label. The default is 'Computation'. You could select 'Custom' and type something like "Total Sales: <Value>" or simply select 'Value' to only show the number.
- In the Format pane, change the appearance of the line: make it thicker, thinner, a different color, or dotted. You can also format the label's font, size, color, and alignment.
Pros: Keeps the focus on the main category bars while still providing the total for context. Highly customizable and visually clean.
Cons: A bit more setup than the Grand Totals method, and it may not be suitable if your visualization gets crowded with other lines or annotations.
Method 3: Creating a Dual-Axis Chart for Maximum Control
The dual-axis method is the most flexible approach and lets you create layered bar charts–for example, showing the total as a wider bar in the background behind your standard category bars. This is also a technique commonly used to create actual vs. target visuals.
Step-by-Step Instructions
1. Create a Calculated Field for the Total
The key to this method is a Level of Detail (LOD) expression that calculates the total sales across all categories.
- Right-click anywhere in the blank space of the Data pane and select Create Calculated Field.
- Name your calculation something memorable, like LOD Total Sales.
- In the formula box, enter the following LOD expression:
- This simple LOD expression tells Tableau: for the entire table of data, calculate the sum of sales, ignoring the dimensions in our view (like Category). Click OK.
2. Build the Dual-Axis Chart
- Start with your basic bar chart again (Category on Columns, SUM(Sales) on Rows).
- Drag your newly created LOD Total Sales calculated field and drop it onto the Rows shelf, to the right of the SUM(Sales) pill. You will see two separate bar charts.
- Right-click the LOD Total Sales pill on the Rows shelf and select Dual Axis from the dropdown menu. This will merge the two charts and their axes.
- To ensure both charts are using the same scale, right-click one of the Y-axes and select Synchronize Axis.
3. Format the Marks Cards
Now, we need to tell Tableau how to display each chart. You'll see a Marks card area with tabs for "All," "SUM(Sales)," and "LOD Total Sales."
- Select the SUM(Sales) Marks card. This represents your individual category bars. Leave the chart type as is (usually Automatic, showing a Bar). Drag the Category dimension from the Columns shelf to the Color tile on this specific Marks card. This gives each bar a distinct color.
- Now, select the LOD Total Sales Marks card. Change its chart type from Automatic to Bar. Drag the Size slider to the right to make this bar thicker than the category bars. This will become our background bar.
- Finally, right-click either of the axes again and choose Move marks to back to ensure the thicker "total" bar is in the background.
You can then add mark labels to both Marks cards independently: put SUM(Sales) on the Label tile for the SUM(Sales) card and LOD Total Sales on the Label tile for the LOD Total Sales card.
Pros: Unmatched flexibility allows for highly customized visual effects. The layered look is extremely effective for part-to-whole analysis.
Cons: The most complex of the three methods, requiring familiarity with LOD expressions and dual-axis charts.
BONUS: Totals in Stacked Bar Charts
What if you want to show a total at the top of a stacked bar chart? This is another common request. Here's a quick way to achieve it using reference lines again, but at a different level of detail.
- Create a stacked bar chart. Start with your simple bar chart (Category on Columns, SUM(Sales) on Rows). Then, drag a dimension like Sub-Category to the Color tile on the Marks card.
- Go to the Analytics pane.
- Drag Reference Line over to your chart, but this time, drop it on the Cell option. Dropping it on Cell tells Tableau to calculate the total for each individual cell in the view (which, in this case, corresponds to each colored bar stack).
- In the edit box that appears, change the label to only show the Value. Format the font or line (or set the line to "None") to make it look just how you want. Now you’ll have a total for each bar stack displayed right at the top!
Choosing the right method depends on the story you want your data to tell. Experiment with each to see which best fits your specific dashboard and audience needs.
Final Thoughts
Showing a total on your bar chart elevates it from a simple comparison to a powerful part-to-whole analysis. Whether you choose the quick Grand Totals option, a clean reference line, or a highly customized dual-axis chart, adding this context will help your audience understand the bigger picture faster.
Mastering tools like Tableau takes time, patience, and lots of practice. Sometimes you just need an answer without becoming a chart-building expert. For those moments, we built Graphed. You can connect your data sources in seconds and ask questions in plain English - like "create a bar chart showing sales by category and add the total" - and we instantly build the visualization for you. It's like having a data analyst on your team who works in seconds, not hours.
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.
DashThis vs AgencyAnalytics: The Ultimate Comparison Guide for Marketing Agencies
When it comes to choosing the right marketing reporting platform, agencies often find themselves torn between two industry leaders: DashThis and AgencyAnalytics. Both platforms promise to streamline reporting, save time, and impress clients with stunning visualizations. But which one truly delivers on these promises?