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.
- Add the Order Date and Profit to the Columns and Region to the Rows.

- 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.

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

Check out: Line Chart in Tableau
- 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.

- 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.

Check out: Tableau Dual Axis Chart
- 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.

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 ENDAfter creating the calculated fields, follow the steps below.
- Add the calculated fields, Profit 2024 and Profit 2025, to the Columns section.

- Drag the SUM(Profit 2025) to the x-axis of Profit 2024; this will create a shared axis chart.

Check out: Tableau Gauge Chart
- 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.

- 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.

Check out: Waterfall Chart in Tableau
- 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.

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:
- Divergent Stacked Bar Chart in Tableau
- Stacked Bar Chart With Multiple Measures in Tableau
- Donut Chart in Tableau
- Sankey Chart in Tableau
- Side By Side Bar Chart in Tableau
- Create Year Over Year Line Chart in Tableau
I am Bijay Kumar, the founder of SalesforceFAQs.com. Having over 10 years of experience working in salesforce technologies for clients across the world (Canada, Australia, United States, United Kingdom, New Zealand, etc.). I am a certified salesforce administrator and expert with experience in developing salesforce applications and projects. My goal is to make it easy for people to learn and use salesforce technologies by providing simple and easy-to-understand solutions. Check out the complete profile on About us.