How to create a stacked bar and a line in Tableau

Have you ever struggled to create a Tableau chart with stacked bars and a line over a period of time?

Open Tableau and follow these instructions:

1. Drag and drop your date pill on your Columns shelf, right click on it and select “Exact Date”.

How to create a stacked bar and a line in Tableau - Step 1

 

 

 

2. Tableau will transform it in Continuous, you’ll have to right click it again and select “Discrete”.

How to create a stacked bar and a line in Tableau - Step 2

 

 

 

3. Now it’s time to include some numbers that will become our bar values.
Drag and drop the Revenue pill into the Rows shelf.

How to create a stacked bar and a line in Tableau - Step 3

4. Drag and drop the Forecast pill that we want to become our line values to the Rows shelf.

How to create a stacked bar and a line in Tableau - Step 4

5. On the Marks section, open the Revenue and select Bar in the dropdown menu:

How to create a stacked bar and a line in Tableau - Step 5

6. Let’s create the stacked bar, which will be per subdivision.
Drag and drop the Subdivision pill to the Color button.

How to create a stacked bar and a line in Tableau - Step 6

 

 

7. Right click the bottom Y axis and choose “Dual Axis”

How to create a stacked bar and a line in Tableau - Step 7

8. Right click it again and select “Synchronize Axis”

This step is very important and only applicable when you have the same unit and magnitude for both axes. In this case, we have Revenue and Forecast, and both are money and have the same magnitude. You won’t want to do this step if you’re using money value in one axis and percentage in the other axis. It’s okay for them to be shown together, but you can’t synchronize their axis because they’re not the same unit and neither the same magnitude.

How to create a stacked bar and a line in Tableau - Step 8
9. There you have it:

How to create a stacked bar and a line in Tableau - Step 9

A very simple and useful tip that is applicable to many situations.

Need more help?

We have plenty more How To Guides here:

How to guides for Tableau beginners