top of page

Bar in a Bar chart? A Lesson in Exclude LODs

  • Writer: Dawn Harrington
    Dawn Harrington
  • 2 hours ago
  • 3 min read

Continuing from last week's blog about creating a Tree map chart inside a Bar chart; this week I will cover how to create a Bar inside a Bar chart! I'm not talking about Stacked bar charts but a series of bars in side a bigger bar!


This blog is also an example of why you would use an EXCLUDE LOD calculation.



This was a Workout Wednesday challenge from early in 2025. Donna Coles provides you with steps using the Subtotals function from the Tableau's Analysis menu here.


Workout Wednesday is a great site to try out your Tableau skills! I arrived at the solution a little differently then the steps provided.


Why do this chart?

When approaching this challenge, I was trying to think of a good use case. This chart is replacing two charts on a dashboard. Not only are you displaying the total Sales for the Region but you are displaying the percentage of the Categories sold inside that Region! It is also encouraging interactivity! Your users will need to hover over the individual Categories to display the Sales for that Category.


Steps I used to create this chart

I placed Region and then Category on the Columns shelf.

Then I placed Sales on the Rows shelf.


I filtered the worksheet by the most recent year (2025) and the last month (November) in my data set.



I created a Fixed Level of Detail (LOD) expression for bigger bar including Order Date.



But a Fixed LOD doesn't work for this use case. Fixed is faster than Exclude or Include but in this circumstance it will give me the value for each Category.



LOD expressions are a bit slower than using the Analysis menu Subtotal functions which are what Donna Coles uses in her blog. They are especially slower with large datasets.


Please note: A recommended practice I perform to check any LOD or complex calculations is to create a text chart to double-check any calculations.



For this chart I needed an Exclude LOD calculated field because I want to get the total for a level above Category. I am telling Tableau that in this view, I want the totals for Region sales and to ignore (or Exclude) the Category it in this calculation.



Here is the view when I replace the Fixed calculated field with the Exclude calculated field. Notice I didn't need to add Order Date before the Sum of Sales in this expression, as it is correctly giving me the amount at the Category level.



All of the bars are the same height for the Exclude calculated field row! I wanted this for the Bar in a Bar chart.

My next steps were to make this a Dual Axis chart and to Synchronize the axis.

I then changed the Marks type on the All Marks card to a Bar.

I also had to right-click on the Exclude Region Sales calculated field to move the marks to back.



For my next step, I needed to change the color for the Exclude calculated field to a light grey. I removed Measure Names from the color view modifier for this. I also changed the size of the bar by moving the slider to the right, as far as it would go.



Then I went back to the Sales Marks card. I made the bars Orange and I added Sales to the Label view modifier.


I added a Percent of total quick table calculation to this Sales pill. I had to right-click on the Sales pill again to Edit the Table calculation.


I had to change this calculation to Pane Across so the Categories added together would equal 100%.



The only steps that are left is the trick Donna Coles uses to put the labels over the middle column.


Here are those modified calculated fields:


Region Total Label

If [Category]='Office Supplies' then [Region] END


Exclude Cat Label

IF [Category] = 'Office Supplies' then [Exclude Region Sales] END


Both calculated fields have to be formatted as an Attribute on the Label view modifier.




Then I performed the normal house cleaning to any worksheet by removing the grid lines, row dividers, formatting the sales values as a currency, hiding field labels etc.




Comments


Subscribe to Tips

If you find my tips useful, please subscribe.

Thanks for submitting!

  • Twitter
  • Facebook
  • Linkedin

© 2023 by BrainStorm. Proudly created with Wix.com

bottom of page