Add Total of Values in Tableau Stacked Bar Chart

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.

  1. To compare the Sales of product categories across regions, add the Sales to Rows and Region to Columns.
Show total in Tableau Stacked Bar Chart
  1. 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.
Stacked Bar chart in Tableau with Total values
  1. 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.
Create a Tableau Stacked chart with total values
  1. Now, click on the second sales in the Rows and select Dual Axis.
Use dual axis to show total in tableau Stacked bar chart
  1. Now, remove the Category(Color) from the s