Add Axis Breaks in Tableau

Chris Geatch
3 min readNov 5, 2022

--

I work in a company/industry where there is often one bar that swamps the others in bar charts, but still needs to be displayed. New York is often involved, so my basic example has that in it. Imagine that I’d like too see more of the variation between the smaller cities, without removing NYC.

a simple bar chart showing one value that is significantly larger than the others

For the TLDR; of those amongst you, this is my end result. Spectacular, I know, but my real world example is more extreme, so it has actually come in handy.

Another bar chart, with the sales on the x-axis truncated for high values

The way I’ve done it is with a series of Table Calculations performed across the City dimension: where a value constitutes more than a certain percentage of the total across all cities, it should be “split”.

The percentage of the total sales that this bar makes up, for comparison with the threshold.

[Percent of Total]
SUM([Sales])/TOTAL(SUM([Sales]))

I’ll need a parameter to decide what the threshold percentage should be, because I can’t be bothered to do some more maths to decide where it should be, fill your boots if you fancy doing that. I use that parameter to calculate the Maximum value below the threshold for a bar being split. This is where I’ll display the shape to denote the split:

[Max Pct Below Threshold]
WINDOW_MAX
(
IF SUM([Sales]) / TOTAL(SUM([Sales])) < [Percentage Threshold]
THEN SUM([Sales]) / TOTAL(SUM([Sales])) END
)

Use the two of those to decide which cities need a marker. Note there is no ELSE, so any values that aren't above the threshold will not get a mark

[Split Marker]
IF [Pct of Total] > [Max Pct Below Threshold] THEN
WINDOW_MAX
(
IF SUM([Sales]) / TOTAL(SUM([Sales])) < [Percentage Threshold]
THEN SUM([Sales]) END
)
END

That’s about all you need from a calculation point of view, then I use those fields to calculated what to display for the bar. Depending on how wide (or tall) your chart is going to be, you may need to adjust the 50% multiplier. Smaller charts will need a bigger percentage, to create enough room for the split.

[Sales Adjusted]
IF [Pct of Total] <= [Max Pct Below Threshold] THEN
SUM([Sales])
ELSE
IF [Preserve Scale Difference] THEN
[Split Marker] * 1.5
+
SUM([Sales]) - [Min Sales Above Threshold]
ELSE
[Split Marker] + ([Split Marker] * 0.5 * [Pct of Total])
END
END

You may notice a bit more than required in there. Initially, I just used the percent of the total to adjust the size of an additional “bit of bar”, but it’s kind of useful to still see what the differce is between high values on the same scale as all the other values, so I created a [Preserve Scale Difference] parameter for the middle part of the calculation above. It required another calculation along the lines of [Max Pct Below Threshold], but to get the minimum sales value that is above the threshold. Finally, I left in the axis labels, but because they no longer apply to the high values, I added in a label field for the high values, and made sure they were furthest from the axis, so the temptation to read from the axis would be lower.

To get the workbook with all of this in, have a look here:

Tableau Public version of the example, link to the workbook is above

--

--

Chris Geatch

I'm a two time (2022-24) Tableau Forums Ambassador, so thought I'd better make a start on the blog for solutions to problems I (or other people) make for myself