Add Total of Values in Tableau Stacked Bar Chart : Bijay Kumar
by: Bijay Kumar
blow post content copied from SalesForce FAQs
click here to view original post
### Summary of the Content The content discusses how to enhance the understanding of sales data by adding total sales values to a stacked bar chart in Tableau. Initially, the sales team found it challenging to interpret the total sales per region because the stacked bars only displayed individual category contributions (Furniture, Office Supplies, Technology). To address this, the author provides a tutorial on two methods to add total values above the stacked bars. 1. **Using Dual-Axis**: This method involves creating a dual-axis chart where one axis displays the stacked sales by category, and the other shows the total sales at the top of the bars. Steps include: - Adding sales to rows and regions to columns. - Stacking bars by category. - Creating a duplicate sales axis and changing its type to Gantt bar. - Synchronizing the axes to align the totals correctly. 2. **Using Reference Lines**: This method involves adding a reference line to display the total sales for each region at the top of the stacked bars. Steps include: - Setting up the stacked bar chart similar to the dual-axis method. - Adding a reference line that sums sales per cell and formatting it to show only the total label without a line. Both methods allow users to visualize total sales while still seeing the breakdown by category. ### Additional Context This tutorial is particularly useful for sales teams and data analysts who rely on visual data representation to make informed decisions. By clearly displaying total sales alongside category contributions, teams can better understand regional performance and make strategic decisions based on comprehensive data insights. ### Relevant Hashtags for SEO #Tableau #DataVisualization #SalesAnalysis #StackedBarChart #BusinessIntelligence #DataAnalytics #TableauTutorial #SalesData #DataScience #VisualizationTips
While analyzing our company’s sales data, I wanted to compare sales by region to see the contribution of each product Category (Furniture, Office Supplies, Technology).
For this, I created a stacked bar chart where each bar represented the sales of a region and was divided into different categories.
Through this Stacked chart, the sales team found it difficult to understand the total sales per region since only the individual category contributions were visible in bars.
To make the visualization easy, I needed to add totals on top of each stacked bar, so that even though the bars are divided into categories, the overall regional sales total is clearly displayed.
In this Tableau tutorial, I will explain how to add the total of values in a Tableau Stacked Bar Chart.
Add Total of Values in Tableau Stacked Bar Chart
There are two methods through which we can add the total of all values in the Tableau stacked bar chart.
- Add Total in Tableau Stacked bar chart using dual-axis
- Add Total in Tableau Stacked Bar Chart using Reference Lines
Add Total in Tableau Stacked Bar Chart Using Dual-Axis
For this Tableau stacked bar chart, we will use the Tableau superstore data set to show the total of values at the top of stacked bars.
Now, connect the datasource with Tableau and follow the steps below to create a stacked bar in Tableau and show the total of values.
- To compare the Sales of product categories across regions, add the Sales to Rows and Region to Columns.

- To distribute the sales of the region, we will stack the bar using the category. For this, add the Category to the Color card in the Marks section.

- To add the values of stacked measures and the total at the top of bars, we will create a dual axis. For this duplicate, the Sales on the Rows and change the Marks type to Gantt bar.

- Now, click on the second sales in the Rows and select Dual Axis.

- Now, remove the Category(Color) from the second Sales axis.

- Now, we will add the labels for the values in both charts ( Gantt chart and Bar chart). The values in the Sales(1) chart will show the stacked values, and Sales(2) will show the values at the top of the stacked bar.

- If the values are not aligned at the top of the bars, then right-click on the Sales axis and select Synchronize Axis.

With this, the total of the values will be stacked at the top of the bars as shown in the image below.

This way, we can add the total at the top of bars in Tableau Stacked bar charts using the Dual-axis charts.
Add Total in Tableau Stacked Bar Chart Using Reference Lines
In this method, we will use the reference lines to show the total of stacked values at the top of the bars.
- Add the Region to Columns, Sales to Rows to show sales in various regions. Then, stack it by adding the Category in the Color card of the Marks section.

- To add the reference line, right-click on the Sales axis and select Add Reference Line.

- Now, configure the reference line in the following way to show the total at the top of stacked bars.
- In the dialog box, set Scope = Per Cell so that each Category gets its own total.
- For Value, choose SUM(Sales).
- Under Label, select Value to show the total number at the end of each stacked bar.
- Format the line as None (remove the actual line) so only the total label appears at the top.

- Now the total of stacked values will appear at the top of the bars. If the total value is not aligned, then click on the value and select Format.

- In the Reference Line Label, select Alignment as Middle. With this, values will be aligned at the top-center of the bars.

- We can also display the sales values for each category in the stacked bars. For this, select Marks -> Label -> Show mark labels.

Now, we can see the sales values for each category and also the total Sales for each region in the Tableau stacked bar chart.

This way, we can show the total values in Tableau stacked bar charts by using the reference lines.
Conclusion
In this Tableau tutorial, we have learned how to add the total of values on top of stacked bar charts. In the above examples, we used two methods to show the total values in stacked bars. One using a Dual-Axis and the other using Reference Lines.
By using either of these two methods, you can easily display the overall measure total in a stacked bar chart, while still keeping the distribution by categories visible.
You may also like to read:
- Create Slope Chart in Tableau
- Create a Circle Timeline Chart in Tableau
- Create Candlestick Chart in Tableau
The post Add Total of Values in Tableau Stacked Bar Chart appeared first on SalesForce FAQs.
August 28, 2025 at 11:37PM
Click here for more details...
=============================
The original post is available in SalesForce FAQs by Bijay Kumar
this post has been published as it is through automation. Automation script brings all the top bloggers post under a single umbrella.
The purpose of this blog, Follow the top Salesforce bloggers and collect all blogs in a single place through automation.
============================

Post a Comment