Stacked Bar Chart in Tableau

Using Tableau, we were analyzing sales performance for our product in each region. I wanted to compare the sales of different product categories in each region.

To visualize this data, I created a stacked bar chart in Tableau that displays the total sales for each region, which are Central, East, South, and West, and stacks them by product category.

In this blog, I will explain what a stacked bar chart is in Tableau and how it can be used to visualize data and show comparisons between categories.

What is a Stacked Bar Chart in Tableau?

In Tableau, or any other data visualization tool, a Stacked bar chart is a type of bar chart that displays the data of different field values into different categories, with each category represented as a segment within the bar. In the stacked bar chart, we can also show sub-categories within a main category.

For example, when analyzing product sales for different regions, a stacked bar chart displays one bar for each region. Each bar is then divided into colored sections representing different product categories. This helps to compare both sales per region and the sales share of each product category within those regions.

In the examples below, I will explain how to create a stacked bar chart using the sample data of the superstore in Tableau. Then we also use Salesforce data to create a stacked bar chart in the second example.

Check out:  Create Pie Chart in Tableau

Create a Stacked Bar Chart in Tableau

In this example, we will create a Tableau that displays statistics on product sales in different regions, categorized by product category.

For this, you can use the existing sample data of the superstore in Tableau Desktop.

  1. After selecting the data source, change the chart type to “Bar” in the “Marks” section.
Create a Stacked chart in Tableau

Check out: Donut Chart in Tableau

  1. The first dimension we will include in the bar chart is the Region; for this, drag the Region to the Columns.
Tableau Stacked bar chart
  1. To display the sales statistics in each region, add the Sales measure to the Rows. Now the bar charts will display the sales stats specific to each.
Add dimension in Tableau Stacked bar chart
  1. To make this bar chart, a stacked bar chart, add the ‘Category‘ dimension from the products in the Color card.

Now the sales stats will be stacked with the product category and show sales for a specific product category in each region.

Add Stacked dimensions in Tableau Stack bar chart

Check out: Stacked Bar Chart With Multiple Measures in Tableau

  1. To display the sales amount for each product category in a specific region, add the Sales measure to the Label card in the Marks section.