Data Viz Done Right

May 19, 2015

Tableau Tip Tuesday: How to Label the Top of Stacked Bars

This week's tip covers two methods for displaying the total of a stacked bar chart. Enjoy!


  1. Replies
    1. Hi Andy,

      We need to plot a stack bar with three diff sales value and also two targets as a scatter.
      Could you please advise if that is possible ?


    2. Siddharth, first, I would recommend you try on your own. This is the best way to learn. Second, yes this is possible, though I'm not sure why you would want a stacked bar and a scatter on the same plot. In my head, I'm picturing sales as a stacked bar on the left axis and budget synchronized on the dual-axis set to a gantt bar. On the gantt bar, you'd have to change the calc to a running total so that they align with the stacks properly.

  2. Hi Andy, very helpful tips. I have a dual axis stacked bar + line chart. I want to show both the grand total and individual values for the stacked bars. My stacked bars are showing 'Number of Records', split by colour for a specific state. Any advice on how best to accomplish this? I've tried both relative line and Gantt methods but neither work, think the dual axis might be the culprit.

    Many thanks!

    1. Double check what is on the Marks card for your secondary axis. Tableau will divide up the bars or lines if you have anything on the marks card.

  3. How would one put a different cell-based value (e.g. MAX(OrderDate)) as the label?

    I am stacking bars in which the colors represent bins of completion time. Typically, I get a large number of green (good) with a possible red (oh no!) which is very small. I would like the top label to have something like MAX(CompletionTime) (bonus points if it could be color-coded) to show which mostly-good bars actually have one or more problematic members. Thoughts?

    1. Tom, if you use the secondary axis/Gantt technique then you can put whatever you want on the label shelf for that axis.