How to Create Stacked Bar Charts in Tableau

Mississauga Jul 01, 2026

Creating a stacked bar chart in Tableau is a powerful way to compare and contrast data across different categories. This chart type allows you to visualize the composition of each category by stacking bars on top of each other, with each bar representing a different dimension of your data. Here's a step-by-step guide to help you create a stacked bar chart in Tableau.

Tableau tip: How to sort stacked bars by multiple dimensions
Tableau tip: How to sort stacked bars by multiple dimensions

Before we dive into the process, ensure you have Tableau installed on your computer and your dataset ready to go. For this guide, let's assume you have a dataset containing sales data for different products and regions over time.

Tableau Tip Tuesday: How to Label the Top of Stacked Bars
Tableau Tip Tuesday: How to Label the Top of Stacked Bars

Preparing Your Data

To create a stacked bar chart, your data should be in a format where each row represents a unique combination of dimensions (e.g., product, region, and time). In our example, each row would represent the sales for a specific product in a particular region during a specific month.

How to in Tableau in 5 mins: Build a Diverging Stacked Bar Chart
How to in Tableau in 5 mins: Build a Diverging Stacked Bar Chart

Your data should also be aggregated to the level you want to analyze. For instance, if you want to compare monthly sales, ensure your data is aggregated by month. You can perform this aggregation in Tableau or using your data source's query tool.

Creating the Stacked Bar Chart

How to Create a Stacked Bar Chart Using Multiple Measures in Tableau
How to Create a Stacked Bar Chart Using Multiple Measures in Tableau

Once your data is prepared, follow these steps to create a stacked bar chart in Tableau:

Drag and Drop Fields

In Tableau, drag and drop the dimension fields (e.g., product and region) to the Columns shelf and the measure field (e.g., sales) to the Rows shelf. This will create a basic bar chart, with each bar representing the total sales for a specific combination of products and regions.

Bar Charts | AnyChart Gallery
Bar Charts | AnyChart Gallery

For example, if you drag 'Product' to Columns, 'Region' to Rows, and 'Sales' to Rows, you'll see a chart with bars representing the total sales for each product in each region.

Create Calculated Fields for Stacking

To stack the bars, you need to create calculated fields that represent the proportion of each dimension within the total. In our example, we'll create calculated fields for the proportion of sales for each product within each region.

the bar chart shows how much people are spending
the bar chart shows how much people are spending

To create a calculated field, right-click on an empty space in the Data pane and select 'Create Calculated Field'. Name your field (e.g., 'Product Proportion') and enter the following formula:

SUM([Sales]) / SUM({FIXED [Region]: SUM([Sales])})

Tableau Stacked Bar Chart - Handle your data in tableau style
Tableau Stacked Bar Chart - Handle your data in tableau style
Stacked bar chart in Tableau
Stacked bar chart in Tableau
How to Create a 100% Stacked Bar Chart with Totals in Excel?
How to Create a 100% Stacked Bar Chart with Totals in Excel?
Improved Stacked Bar Charts with Tableau Set Actions - Canonicalized
Improved Stacked Bar Charts with Tableau Set Actions - Canonicalized
Stacked Bar Chart Maker – 120+ stunning chart types
Stacked Bar Chart Maker – 120+ stunning chart types
Side by Side  Bar Chart in #tableau  | Tableau #tutorial for beginners | Session 25 #data
Side by Side Bar Chart in #tableau | Tableau #tutorial for beginners | Session 25 #data
a large poster with many different colors and shapes on it's sides, including the words bar chart
a large poster with many different colors and shapes on it's sides, including the words bar chart
the top 10 visual bar chart designs
the top 10 visual bar chart designs
Exploded Bar Chart
Exploded Bar Chart
the bar chart menu is filled with information
the bar chart menu is filled with information
Stacked Bar Chart Alternatives - Peltier Tech
Stacked Bar Chart Alternatives - Peltier Tech
How to Make a Diverging Bar Chart in Tableau
How to Make a Diverging Bar Chart in Tableau
a bar chart showing the number of people in different countries
a bar chart showing the number of people in different countries
How to Visualize Sentiment and Inclination
How to Visualize Sentiment and Inclination
Bar Chart Templates
Bar Chart Templates
Dataviz Challenge #3: How to Make a Side by Side Bar Chart in Excel
Dataviz Challenge #3: How to Make a Side by Side Bar Chart in Excel
Tableau Bar Chart - Learn to Create 4 Variants of Bar Charts in Tableau
Tableau Bar Chart - Learn to Create 4 Variants of Bar Charts in Tableau
How to Create a Marimekko Chart in Tableau
How to Create a Marimekko Chart in Tableau
Stacked Bar Chart Alternatives - Peltier Tech
Stacked Bar Chart Alternatives - Peltier Tech
ASP.NET MVC Charts & Graphs with Simple API | CanvasJS
ASP.NET MVC Charts & Graphs with Simple API | CanvasJS

This formula calculates the proportion of sales for each product within each region. Repeat this process to create a calculated field for each dimension you want to stack (e.g., 'Region Proportion').

Stack the Bars

Now that you have your calculated fields, you can stack the bars. Drag the first calculated field (e.g., 'Product Proportion') to the Color shelf. This will color each bar according to the proportion of the first dimension.

To add more dimensions to the stack, right-click on the Color shelf and select 'Add Another Field'. Drag the next calculated field (e.g., 'Region Proportion') to the shelf. Repeat this process to add as many dimensions as you want to stack.

Customizing Your Chart

Once you have your stacked bar chart created, you can customize it to better suit your needs:

Sorting and Filtering

You can sort the bars on the chart by dragging the dimension fields to the Sort shelf or using the 'Sort' option in the menu. You can also filter the data by right-clicking on a dimension field in the Data pane and selecting 'Filter'.

For example, you can sort the bars by the total sales for each product or filter the data to show only a specific region.

Adding Titles and Labels

To make your chart more readable, add titles and labels. Right-click on an empty space in the chart and select 'Edit Axis'. You can then change the title and labels for the axes. You can also add a chart title by right-clicking on the chart and selecting 'Add Title'.

For instance, you can change the title of the x-axis to 'Region' and the title of the y-axis to 'Sales (in $)' to make the chart more informative.

Creating a stacked bar chart in Tableau is a great way to visualize the composition of your data and compare different dimensions. With a little practice, you'll be able to create engaging and informative charts that help you and your team make data-driven decisions. Happy charting!