Bar Charts in Tableau
Build vertical and horizontal bar charts, sort bars, add labels and colour, and use bar charts to compare the EVIKA dataset by category, product, and city
The bar chart is the most useful chart in data analytics. It is not the most glamorous, but it is the one you will use in 60–70% of your dashboards — because it communicates comparison clearly, works for any audience, and is fast to read.
Tableau makes bar charts exceptionally easy to build: drag a Dimension to Columns, drag a Measure to Rows, and a bar chart appears. The interesting part is what you do next — sorting, colouring, labelling, stacking, and choosing between vertical and horizontal orientations for different data shapes.
One rule that separates analysts who make good charts from those who make bad ones: sort your bars. An unsorted bar chart forces the reader to search for the highest and lowest values. A sorted bar chart communicates the ranking instantly. In Tableau, sorting takes two seconds and makes every bar chart significantly more useful.
By the end of this chapter you will know how to build any bar chart a manager or client might ask for — simple comparison, stacked, side-by-side, horizontal — with professional formatting.
- How to build a vertical and horizontal bar chart in Tableau
- How to sort bars, add colour, and add labels
- How to build stacked and side-by-side bar charts
- When to use each bar chart type for different comparison questions
Ch 6 Ex 1 — Revenue by category (basic vertical bar)
Goal: show which product category generates the most revenue
Step 1: Open a new worksheet
Step 2: Drag Category (Dimension) → Columns shelf
Step 3: Drag Total Amount (Measure) → Rows shelf
→ Tableau auto-creates a vertical bar chart
Step 4: Sort descending:
Click the Sort Descending icon in the toolbar
(or right-click the axis → Sort → Descending)
Result:
Category | SUM(Total Amount)
─────────────────────────────────
Furniture | ₹11,397
Electronics | ₹4,186
Stationery | ₹985 (approx, based on EVIKA orders)
Step 5: Right-click any bar → Mark Label → Always Show
→ Revenue values appear on top of each barCh 6 Ex 2 — Horizontal bar chart (many categories)
Horizontal bars work better when: → You have many categories (labels are long) → Category names overlap in a vertical chart How to flip from vertical to horizontal: Method 1: Click the Swap Rows/Cols button in toolbar Method 2: Drag Category to Rows, Total Amount to Columns Result: horizontal bar chart Ergonomic Chair ████████████████████ ₹8,999 USB-C Hub ████ ₹1,499 Desk Lamp ███ ₹1,199 Wireless Mouse ██ ₹899 Notebook A5 █ ₹495 Ballpoint Pens █ ₹490 HDMI Cable ▌ ₹299 Product name labels are readable — no rotation needed.
Ch 6 Ex 3 — Colour bars by category
Add colour encoding to highlight categories: Step 1: Build the Revenue by Product chart (Ex 2) Step 2: Drag Category (Dimension) → Marks > Color Result: each bar is coloured by its category: Ergonomic Chair ██ (Furniture — blue) USB-C Hub ██ (Electronics — orange) Desk Lamp ██ (Furniture — blue) Wireless Mouse ██ (Electronics — orange) ... Customise colours: Click the Color legend → Edit Colors → assign specific colours to each category → Tableau's default palette is accessible (colour-blind safe) Add a colour legend title: Right-click the legend → Edit Title → type "Category"
Ch 6 Ex 4 — Stacked bar chart (revenue by city, stacked by category)
Goal: show each city's revenue AND which category drives it
Step 1: Columns: City
Step 2: Rows: SUM(Total Amount)
Step 3: Marks > Color: Category
→ Tableau stacks segments by category automatically
Result:
City | Stacked bar (each segment = category)
────────────────────────────────────────────────────
Mumbai | ████████████████ (Furniture — Ergonomic Chair)
Noida | ████████ (mix of Electronics + Stationery)
Delhi | ████ (Electronics)
Bengaluru | ▌ (Electronics)
Pune | (no orders)
Step 4: Add labels to segments:
Marks > Label → drag SUM(Total Amount) onto Label
Label → "Selected" → check "Min/Max" to avoid clutterCh 6 Ex 5 — Side-by-side bar chart
Goal: compare category revenue within each city side by side Step 1: Columns: City, Category (drag Category after City) Step 2: Rows: SUM(Total Amount) Step 3: Marks > Color: Category (optional — adds colour) Result: within each city, one bar per category appears side by side: Noida: Electronics ██ Furniture ████ Stationery █ Mumbai: Furniture ████████████████ Delhi: Electronics ████ This makes it easy to compare categories WITHIN a city and ACROSS cities at the same time. Tip: add a reference line for the overall average: Right-click the Y axis → Add Reference Line → Value: Average (SUM(Total Amount)) → Label: "Average ₹2,154"
When to use each bar chart type
| Chart type | Use when | Avoid when |
|---|---|---|
| Vertical bar | Comparing 3–8 categories with short names | Labels overlap or names are long |
| Horizontal bar | Many categories or long category names | You have fewer than 4 categories |
| Stacked bar | Showing composition (what makes up each total) | Comparing individual segments is the goal |
| Side-by-side bar | Comparing sub-categories within each group | More than 4 sub-categories per group |
| 100% stacked bar | Showing percentage share, not absolute values | Absolute totals matter to the audience |
Key Points
- ✓Always sort bars — sorted descending is the default for comparison charts
- ✓Horizontal bars are better than vertical when category names are long
- ✓Drag a Dimension to Marks > Color to add colour encoding and a legend
- ✓Stacked bars show totals and composition; side-by-side bars enable segment comparison
- ✓Add labels (Marks > Label) so readers do not have to guess exact values from the axis
Tips
FAQ
You have 12 product names, each with a long descriptive name, and you want to compare their revenue. Which bar chart orientation should you use?