Module 04 · Building visuals
Formatting & colour
One accent colour, red for anything below target, number labels, and no grid lines.
A tidy chart is quicker to read, and the right colour makes it speak. In Tableau, conditional colour comes from a True/False calculated field placed on Color. The example: red bars for products whose revenue is below the Rp100 million target. Use the Revenue by Product bar chart sheet from Module 1.
Click a number on the picture or in this list to highlight that area.
Step by step
-
Step 1: Create a calculated field with Analysis → Create Calculated Field..., name it
Below Target, type this formula, then click OK. Drag the new field from the Data pane to Color on the Marks card (number 1).TableauSUM([Revenue]) < 100000000Watch out: Use
SUM([Revenue]), not just[Revenue]. Without SUM, Tableau compares every order row, and because every single order is below Rp100 million, all bars end up "below target". -
Step 2: Set the colours in the legend that appears to the right of the view (number 4): click the small arrow in the legend title → Edit Colors.... Click True and then a red swatch, click False and then one calm colour (e.g. blue), then OK. Next, drag Revenue to Label on the Marks card (number 2) so the number shows at the end of each bar.
Tip: Label numbers too long? Right-click the SUM(Revenue) pill with the Label icon → Format... → Pane tab → Default → Numbers → Number (Custom): Display Units Millions (M) and Decimal places 1. With 1 decimal, Headset reads 99.9M (99,9M on a computer set to Indonesian) instead of 100M.
Watch out: One accent colour beats a rainbow. Reserve red for genuine problems.
-
Step 3: Remove the grid lines with Format → Lines.... The Format pane (number 3) opens in place of the Data pane. On the Sheet tab, click the Grid Lines dropdown and choose None. Close the pane with the × at its top-right corner to return to the Data pane.
Tip: The Format menu also has Font..., Shading... and Borders... with the same tabs (Sheet, Rows, Columns). Change things on the Sheet tab so they apply to the whole sheet.