In this blog post, let’s see how to create a nested bar chart. This chart is also known as overlapped bar chart.

For this we are using the ‘Sample – Superstore’ dataset and we are going to create a visualization for ‘Sales and Profit by Category’.

Step 1:

First, let’s add the categories to rows shelf. Here, we will add both ‘Category’ and ‘Sub-Category’ as it provides more details.

Step 2:

Next, we can add the measure values (Sales and Profit) to the Column Shelf. This will automatically create a bar graph and we can see the distribution of profits and sales across different categories.

Step 3:

As the next step, let’s copy the measure names to ‘Size’ in the Marks window. Now, you will be able to see that it has allocated different sizes to Profit and Sales.
In this case, profits are shown in smaller bars compared to Sales.

Step 4:

For a better view, let’s add ‘Measure Names’ to colour card. And here I have used two contrasting colours for a better view.

Step 5:

Next step is to lay profit bars over sales bar. In order to do that, go to the ‘Analysis’ tab and select the ‘Stack Marks’ option and set it as ‘Off’.

Now, you will see a view like below.

Step 6:

The next step is all about formatting. Let’s increase the size of the profit bars and edit the title.

So, here’s our nested bar chart.

The Data School
Author: The Data School