skip to content

In Tableau, why do bars stack when you drop a dimension on Color?

level: middleimportance: should knowfreq 45%

answer

  1. colour did two jobs, not one
  2. the bar length is protecting the total
  3. the setting lives in the Analysis menu
  4. only the bottom segment starts at zero
  5. turning it off overlaps rather than separates

basics

~20 s

With a Bar mark, Tableau stacks segments by default once a dimension on the Marks card splits each bar, so the full bar length stays the category total. Analysis then Stack Marks switches stacking off or on.

solid answer

~50 s

A dimension on Color adds to the view's level of detail, so each bar is now several marks instead of one. Tableau's default `Stack Marks` setting is Automatic, and for bar and area marks that means stacking them end to end — which keeps the overall bar length equal to the category total. The trade-off is perceptual: only the bottom segment sits on a shared baseline, so comparing a middle segment across categories is guesswork, and negative values stack in a way most readers misread. Turning stacking off under **Analysis > Stack Marks** makes the segments share the baseline and overlap, hiding the smaller ones behind the larger — which usually looks like missing data. If the comparison matters more than the total, move the dimension from Color to Rows or Columns for side-by-side bars, or build small multiples.

code

text · 9 lines
text
-- Stacked: one bar per category, segments end to end
Columns: Category
Rows:    SUM(Sales)
Color:   Region          -- adds to the level of detail AND stacks

-- Side by side: every segment shares the zero baseline
Columns: Category / Region   -- Region moved onto the shelf
Rows:    SUM(Sales)
Color:   Region

go deeper

for a junior

Know that a dimension on Color splits each bar into segments and that Tableau stacks them by default, and be able to find the Stack Marks option under the Analysis menu.

for a middle

Explain both effects of the colour drop — encoding plus level of detail — and why Automatic stacks bar and area marks. Describe what turning stacking off actually does, rather than assuming it separates the marks.

for a senior

Argue the chart choice: when preserving the total beats comparison, when side-by-side or small multiples are required, and why negative values break the stacked reading. Expect to critique an existing dashboard on these grounds.

for a principal

Own the standard: which chart forms are sanctioned for shared reporting, how composition versus comparison is decided, and how you stop misleading defaults from propagating through templates that dozens of analysts copy.

## Why the bar splits at all Dropping a dimension on Color does two things at once, and people only notice one of them. It assigns a colour per member, and it **adds that dimension to the view's level of detail**. The bar that was one mark for `Furniture` becomes four marks — one per region within Furniture. Colour is the visible half; the granularity change is the half that alters the picture. ## What stacking is Once a bar position holds several marks, Tableau must decide where to draw them. The `Stack Marks` setting under the **Analysis** menu has three states: Automatic, On and Off. Automatic is the default, and for **bar** and **area** marks it stacks: each segment starts where the previous one ended, so the bar's total length equals the sum of its segments — the category total. Line, circle and square marks do not stack; several marks simply sit at their own positions. This default is defensible. When you split a total by a categorical field, the reader usually still wants the total to be legible, and stacking preserves it. ## Where stacked bars mislead **Only one segment has a baseline.** Human position judgment is accurate against a common baseline and poor otherwise. In a stacked bar, the bottom segment is easy to compare across categories; every segment above it starts at a different offset, so comparing the third segment across five bars is close to guessing. If the question is "which region grew", a stacked bar is the wrong chart. **Negatives are ambiguous.** With a mix of positive and negative values, segments extend in both directions and the visible bar length no longer reads as the total. Profit by category split by sub-category is the classic case where the chart quietly stops meaning what people assume. **Ordering is invisible.** Segment order comes from the colour field's sort, and changing that sort changes which segment gets the baseline — so two views of the same data can support different visual conclusions. **Turning stacking off is not free.** With `Stack Marks` set to Off, all segments start at zero and overlap, so a small segment disappears behind a large one. Readers report this as "the data is missing". Off is useful for deliberately overlapping comparisons — such as actual drawn over target — usually combined with transparency or a different mark type, not as a general fix. ## The alternatives - **Side-by-side bars.** Move the dimension from Color to Rows or Columns (keeping it on Color if you still want the hue). Now every segment shares the baseline and cross-category comparison is accurate. You lose the immediate read of the total. - **Small multiples.** One small chart per member, all on the same axis scale. Excellent for comparing shapes across many members; needs space. - **100% stacked.** Convert values to a percent of total so every bar fills the same length and the chart is about composition, not magnitude. This is done with a percent-of-total table calculation, which belongs to Tableau's calculation surface rather than the mark card. - **Just show the total, and let interaction do the rest.** A plain bar of the total with the breakdown on tooltip or a linked view is often the honest choice. ## Related mark card behaviour worth knowing Stacking interacts badly with **dual axis** charts: two axes each with their own Marks card, both stacking, produce a chart very few readers decode correctly. If you build a dual axis with bars, check the stacking state on both marks cards explicitly rather than trusting Automatic. Also note that stacking is a *rendering* decision, not an aggregation one. The measure values are identical whether stacking is on or off; only the drawn positions change. If the numbers themselves changed, the cause was the granularity change from the dimension, not the stacking. ## The interview answer Say that a dimension on Color both colours and refines the grain; that Automatic stacking for bar and area marks preserves the total at the cost of a shared baseline; that switching stacking off overlaps rather than separates; and that side-by-side bars or small multiples are the right move when comparison beats total. Naming the negative-values failure earns the rest of the point.

  • When would you deliberately turn Stack Marks off in Tableau rather than switching to side-by-side bars?
    When you want two series drawn against the same baseline on purpose — an actual bar overlapping a wider target bar is the classic pattern. It relies on one series being reliably smaller, or on transparency and differing mark sizes, so the hidden series is intentional. As a general fix for stacking it fails, because smaller segments simply vanish behind larger ones.
  • Which Tableau mark types stack by default, and which do not?
    Bar and area marks stack under the Automatic setting, since both encode magnitude as extent from a baseline and stacking preserves the total. Line, circle, square and shape marks do not stack; multiple marks are drawn at their own positions and may overlap. You can force any of them with Analysis then Stack Marks set to On or Off.
  • How do you keep the total legible while still allowing accurate comparison of the parts?
    Split the job across two views: a plain bar of the total for magnitude, and a side-by-side or small-multiples view for the breakdown, linked so selecting a category filters the detail. If space allows only one chart, prefer side-by-side and print the total as a label, which restores the number without asking the reader to judge stacked lengths.

A stacked bar is a stack of books measured for total height: the pile's height is easy to read, but only the bottom book starts at the table, so comparing the third book across several piles is guesswork.

saying these in an interview costs you the question

  • Thinks a dimension on Color only changes colour
  • Compares middle segments across stacked bars as if reliable
  • Turns stacking off and reports the data as missing
  • Uses stacked bars for measures that can go negative
  • Believes stacking changes the aggregated values

context