Tableau Bar in Bar Chart [Complete Guide with Steps]

In data visualization, comparing values clearly is very important. Sometimes, a simple bar chart is not enough when you want to compare two measures in the same category.

This is where the Tableau Bar in a Bar Chart becomes very useful. A Bar in a Bar Chart allows you to display one bar inside another bar.

It helps you easily compare two values, such as target vs. actual salescurrent year vs. previous year, or planned vs. achieved performance.

As a data analyst, I worked with the sales team to analyze and compare product sales across regions in 2024 and 2025.

To visualize this data, I created a “bar in a bar chart” in which one bar chart was embedded within the other, displaying the 2024 and 2025 sales profit data.

In this blog, I will explain what a bar-in-bar chart is and how to build a bar-in-bar chart in Tableau. We will cover the definition, step-by-step creation process, examples, comparison with other charts, and FAQs.

What is a Bar in a Bar Chart in Tableau?

A Bar in a Bar Chart is a type of visualization in which one bar is placed inside another to compare two measures within the same category.

Simple Definition: A Bar in a bar chart shows two values using overlapping bars, with one bar representing the main value and the other showing the comparison data.

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 a single 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 when both metrics share the same scale, allowing us to easily compare two values on a single bar.

Why Use Bars in a Bar Chart?

You should use this chart when:

  • You want to compare two measures
  • You need to show the difference clearly
  • You want a clean and simple visualization

Example Use Cases:

  • Sales vs Target
  • Profit vs Cost
  • Current Year vs Previous Year

Steps to Create a Bar in a Bar Chart in Tableau

In Tableau, we can create a bar chart with two scenarios: one compares two dimensions, with one dimension nested inside the other.

The other way to create this chart is to compare two measures nested within a single bar.

Create a Bar in a Bar Chart Comparing Dimensions in Tableau

In this bar chart, we will compare sales profit for 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 for other years, click them and select Exclude.

Another way to exclude the year is to right-click the Order Date in the Columns, select Edit Filter, keep only 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, with 2025 data stacked over 2024 data.
Nested Bar Chart in Tableau
  1. This stacked bar chart is not suitable for comparison because the 2025 values 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.
    • 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 the other is 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 a 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 calculate profits for 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 SUM(Profit 2025) to the x-axis of Profit 2024 to 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 from both years start from the baseline rather than 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 that the 2024 data is nested within the 2025 bar, and we can see the profits of both years in the bar for a specific region.

Create a Tableau Bar in bar Chart

This way, we can create a bar chart in Tableau, either a single bar or a nested bar chart, 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, how to create one for dimensions and measures, and how to compare their data metrics within a single bar.

Bar in Bar Chart vs Other Charts

FeatureBar in Bar ChartStacked Bar ChartSide-by-Side Bar Chart
Comparison TypeTwo valuesParts of a wholeMultiple categories
ClarityHighMediumHigh
Use CaseTarget vs ActualDistributionCategory comparison

A standard bar chart is used to visually compare categories.

Frequently Asked Questions

1. What is a bar in a bar chart in Tableau?

It is a chart that shows one bar inside another to compare two values.

2. How is it created?

Using dual axis and adjusting bar size.

3. When should I use it?

When comparing two values like actual vs target.

4. Is it better than a stacked bar chart?

Yes, for comparison clarity, it is better.

5. Can I use more than two measures?

No, it is best for only two measures.

Conclusion

The Tableau Bar in a Bar Chart is a powerful visualization technique that helps clearly and effectively compare two values. It is easy to create and provides better decision-making insights.

By following the steps explained in this article, you can easily build this chart in Tableau and use it in dashboards.

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.