How to create a stacked bar chart using Tableau

Posted on Mar 11, 2022

A guide on creating a stacked bar chart in Tableau


A stacked bar chart is a vertical bar graph that shows the partial data that makes up the bar.

Each bar in the stacked bar chart will show the distinct values from the category you have included in the chart.

This chart allows you to see and compare the partial values from each bar.

The example below shows a stacked bar chart of an office supplies company sales report:

Note how the sales record of each item has three segmented bars showing the total sales of each city where the company operates: Edinburgh, London, and Newcastle.

To create the graph shown above, you can use the sales data CSV file used as the data source here:

SalesData.csv

Load the dataset as a Text File into Tableau, then open the Sheet page and do the following steps:

  • Drag the City and Item variables to the Columns shelf.
  • Drag the Total Sales variable to the Rows shelf.

You will have a vertical bar graph as shown below:

Next, you need to open the Show Me pane and click on the stacked bars icon at the second column on the third row.

Now you should see a stacked bar chart generated on your sheet as follows:

To make the chart more informative, you can add the City and Total Sales variable as Labels to the sheet.

The chart should look more informative with the marks added:

And that’s how you create a stacked bar chart with Tableau.

You can view and download the Workbook that shows the chart here:

Tableau Stacked Bar Chart Example

Now you’ve learned how to create a stacked bar chart using Tableau. Good work! 👍

Level up your programming skills

I'm sending out an occasional email with the latest programming tutorials. Drop your email in the box below and I'll send new stuff straight into your inbox!

No spam. Unsubscribe anytime.