How to Build a Bar in Bar Chart in Tableau

As a data analyst, I was working with the sales team to analyze and compare the product sales across different regions in year 2024 and 2025 . To visualize this data, I created a “bar in a bar chart” in which one bar chart was embedded inside the other one, displaying the data of 2024 and 2025 sales profit.

In this blog, I will explain what a bar-in-bar chart is and how to build a bar-in-bar chart in Tableau.

What is a Bar in Bar Chart in Tableau?

In Tableau, a Bar-in-Bar chart is used to compare two related measures for the same dimension side by side, such as actual sales versus target sales. It displays one bar nested or embedded within another.

In this chart, the outer bar represents the target value, while the inner, narrower bar shows the actual value.

Bar-in-bar charts are helpful in scenarios where both metrics share the same scale, allowing us to easily compare two values on a single bar.

Create a Bar in Bar Chart in Tableau

In Tableau, we can create a Bar in bar chart for two scenarios, one is comparing two dimensions, where one dimension will be nested inside the other in a single dimension. The other way to create this chart is by comparing two measures nested in a single bar.

Create a Bar in Bar Chart Comparing Dimensions in Tableau

In this bar in bar chart, we will compare the sales profit for the years 2024 and 2025. For this, connect with the Tableau Superstore data and follow the steps below.

  1. Add the Order Date and Profit to the Columns and Region to the Rows.
Tableau bar in bar chart
  1. In this data visualization, we will compare the data from 2024 and 2025. To remove the data of other years, click on them and select exclude.

Another way to exclude the year is to right-click on the Order Date in the Columns, select  Edit Filter, and in the filters only keep the years 2024 and 2025, and click OK.

Bar in Bar chart Tableau

With this, we will see two charts displaying sales profit for specific regions.

Compare two dimensions in Tableau Chart

Check out: Line Chart in Tableau

  1. Now, remove the Order date from the Columns and drop it in the Color card in the Marks section.

The bar chart will be displayed as a stacked bar chart, where we see data of 2025 stacked over data of 2024.

Nested Bar Chart in Tableau
  1. This stacked bar chart is not suitable for comparison because the values of 2025 do not start from the same baseline.

To ensure all values start from the same baseline, click on the Analysis tab > stack Marks > Off.

Create Embedded bar Chart in Tableau

Check out: Tableau Dual Axis Chart

  1. Now, both bars will start from the baseline and overlap, but this will hide the bar with less data than the other. For example, if in the central region, the 2024 sales profit is 8000, and the 2025 profit is 14000, then it will only display the 2025 data in the bar.

To show both years’ data in each chart, we need to reduce the size of one data bar so that the other one can be visible.

Tableau Nested Bar Chart

We can also adjust the thickness of the nested bar using the slider in the Size card. This way, we can create a bar in a bar chart or a nested chart in Tableau.

Check out: Bullet Chart in Tableau

Create a Bar in Bar Chart Comparing Measures in Tableau

In the previous example, we created a bar in a bar chart using the discrete dimension Order Date. In this example, we will see how to create a bar in a bar chart by comparing two measures in Tableau.

For the measures, I have created two calculated fields that give profits for the years 2024 and 2025 using the formulas below.

//Profit 2024
IF YEAR([Order Date]) = 2024 THEN [Profit] ELSE 0 END

//Profit 2025
IF YEAR([Order Date]) = 2025 THEN [Profit] ELSE 0 END

After creating the calculated fields, follow the steps below.

  1. Add the calculated fields, Profit 2024 and Profit 2025, to the Columns section.
Nested Bar Chart in Tableau for Measures
  1. Drag the SUM(Profit 2025) to the x-axis of Profit 2024; this will create a shared axis chart.
Overlapped Bar Chart Tableau

Check out: Tableau Gauge Chart

  1. In the shared axis chart, drag the discrete dimension Measure Names to the Color card in the Marks section. This will stack the data for the years 2024 and 2025.
Create Bar in Bar Chart in Tableau
  1. Click on the Analysis tab and select Stack Marks >off. This makes the data of both years start from the baseline instead of being stacked.
Tableau bar in bar chart for measures

Check out: Waterfall Chart in Tableau

  1. To make the overlapped bars visible, we need to adjust the size of the nested bar. For this, drag the Measure Names from the filter to the Size card.

Now, we can see the data of 2024 is nested inside the bar of 2025, and we can see the profits of both years in the bar of a specific region.

Create a Tableau Bar in bar Chart

This way, we can create a bar in a bar or a nested bar chart in Tableau by comparing two measures on the same bar.

By following the steps above, I hope you have understood what a bar in a bar chart is and how to create one for dimensions and measures, and compare their data metrics within a single bar.

You may also like to read:

Agentforce in Salesforce

DOWNLOAD FREE AGENTFORCE EBOOK

Start with AgentForce in Salesforce. Create your first agent and deploy to your Salesforce Org.

Salesforce flows complete guide

FREE SALESFORCE FLOW EBOOK

Learn how to work with flows in Salesforce with 5 different real time examples.