How to Build a Bar in Bar Chart in Tableau : Bijay Kumar
by: Bijay Kumar
blow post content copied from SalesForce FAQs
click here to view original post
### Summary of Bar-in-Bar Chart Creation in Tableau In this blog, a data analyst describes how to create a bar-in-bar chart in Tableau to compare sales profits for the years 2024 and 2025 across different regions. A bar-in-bar chart involves one bar embedded within another, which allows for easy visual comparison of two related sales metrics. **Key Details:** - **What is a Bar-in-Bar Chart?** It allows for side-by-side comparison of two related measures within the same dimension. The outer bar represents one metric, while the inner bar represents another metric, such as actual sales compared to target sales. - **Creating a Bar-in-Bar Chart in Tableau:** 1. **Comparing Dimensions:** - Use sales data from 2024 and 2025. - Exclude data from other years in the Order Date filter. - Create a stacked bar chart, but for better comparison, turn off stacking to align the bars at the same baseline. - Adjust the size of one bar to ensure both are visible. 2. **Comparing Measures:** - Create calculated fields for profits of 2024 and 2025. - Add these fields to the chart’s axis. - Adjust settings to prevent stacking and ensure visibility of both measures by modifying the size of the bars. ### Additional Context: These charts are particularly useful for sales teams to visually assess performance over different years, helping them identify growth trends and areas needing improvement. Utilizing tools like Tableau for such visualizations can enhance data interpretation and strategic decision-making. ### Hashtags for SEO: #DataVisualization #Tableau #BarInBarChart #SalesAnalysis #DataAnalytics #BusinessIntelligence #SalesTrends #TableauTutorial #DataInsights #ComparisonChart
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 END
After 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.

- 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.
The post How to Build a Bar in Bar Chart in Tableau appeared first on SalesForce FAQs.
July 17, 2025 at 07:22PM
Click here for more details...
=============================
The original post is available in SalesForce FAQs by Bijay Kumar
this post has been published as it is through automation. Automation script brings all the top bloggers post under a single umbrella.
The purpose of this blog, Follow the top Salesforce bloggers and collect all blogs in a single place through automation.
============================

Post a Comment