Tutorials › Tableau › Pie Charts, Treemaps & Text Tables

Pie Charts, Treemaps & Text Tables

When to use pie charts and treemaps for part-to-whole analysis, and how to build clean text tables (crosstabs) for detailed data reporting in Tableau.

Not every insight needs a bar or line chart. Part-to-whole relationships — what share of revenue does each product category contribute? — are best shown with pie charts or treemaps. Detailed numerical comparisons across two dimensions are best shown in text tables (also called crosstabs). This chapter covers all three.

Pie charts are the most debated chart type in data visualisation. They work well with 2–4 categories and clear differences in proportion — but fail completely with 7+ categories or similar slice sizes. Treemaps solve most of pie charts' limitations while keeping the part-to-whole message. Text tables are the analyst's workhorse for data-dense reports where readers need exact numbers.

What you will learn
  • Building a pie chart and when NOT to use one
  • Converting a pie chart to a donut chart
  • Building a treemap — size and colour by two measures
  • Building a text table (crosstab) with totals and sub-totals
  • Formatting numbers, alignment, and colour in text tables
  • Highlighting cells with conditional colour in a text table

Building a pie chart — revenue share by product category

Step 1 — Change the mark type:
  Marks card → Mark Type = Pie.

Step 2 — Add the measure to Angle:
  Drag REVENUE to the Angle shelf.
  → Tableau draws one large circle (all data aggregated).

Step 3 — Add the dimension to Color:
  Drag PRODUCT_CATEGORY to the Color shelf.
  → Tableau splits the circle into one slice per category.

Step 4 — Add percentage labels:
  Drag PRODUCT_CATEGORY to Label shelf.
  Drag REVENUE to Label shelf → format as percentage:
    Label shelf → Insert → Quick Table Calculation → Percent of Total.

Step 5 — Sort slices (largest first):
  Right-click PRODUCT_CATEGORY on Color → Sort → Descending
  by SUM(Revenue).

EVIKA Example:
  Revenue by category:
  Electronics 45% | Accessories 28% | Software 17% | Other 10%

WHEN NOT TO USE PIE:
  ✗ More than 5 categories → use bar chart instead
  ✗ Similar slice sizes → readers cannot compare angles accurately
  ✗ Negative values → pie charts cannot show negatives

Converting a pie chart to a donut chart

A donut chart is a pie with a white circle in the centre —
looks cleaner and allows a KPI in the middle.

Step 1 — Build the pie chart.

Step 2 — Add a placeholder measure to Rows:
  Drag MIN(1) (type it as a formula) to the Rows shelf.
  → You now have two separate charts.

Step 3 — Make Dual Axis:
  Right-click the MIN(1) pill → Dual Axis.

Step 4 — Set the second chart to a white filled circle:
  Marks card → second tab (MIN(1)):
  → Mark Type = Circle.
  → Color = White.
  → Size = drag slider to cover the pie centre.

Step 5 — Remove the second axis header:
  Right-click the right Y axis → Uncheck "Show Header".

Step 6 — Add a KPI label to the white circle:
  Second tab → Label shelf → type total revenue or %
  using Insert > Field dropdown.

Result: a donut with a clean white centre showing the total.

Building a treemap — revenue and orders by product

A treemap shows part-to-whole using rectangle area (size)
and optionally a second measure using colour.

Step 1 — Change the mark type:
  Marks card → Mark Type = Square.
  (Tableau does not have a "Treemap" mark — it uses Square.)

Step 2 — Add dimension to Label and Detail:
  Drag PRODUCT_NAME to the Label shelf.

Step 3 — Add the size measure:
  Drag REVENUE to the Size shelf.
  → Tableau resizes each square proportional to revenue
    and arranges them in a treemap layout.

Step 4 — Add the colour measure:
  Drag ORDER_COUNT to the Color shelf.
  → Dark = many orders, Light = few orders.

Step 5 — Format:
  Color → Edit Colors → choose a sequential palette.
  Add borders: Color → Border → Dark grey, 1px.
  Label: right-click → Format → Font 10pt → Middle-Centre align.

EVIKA Example:
  Largest rectangle = P01 Laptop (highest revenue)
  Darkest colour = P03 USB Hub (most orders, low unit price)
  Insight: Laptop drives revenue; USB Hub drives order volume.

Building a text table (crosstab) with totals

A text table shows numbers in a grid: rows on one dimension,
columns on another, values in the cells.

Step 1 — Drag dimensions to Rows and Columns:
  PRODUCT_CATEGORY → Rows.
  ORDER_MONTH (discrete, Month of Year) → Columns.

Step 2 — Add the measure to the Text shelf:
  REVENUE → Text shelf.
  → Numbers appear in each cell.

Step 3 — Add Grand Totals:
  Analysis menu → Totals → Show Row Grand Totals.
  Analysis menu → Totals → Show Column Grand Totals.

Step 4 — Format numbers:
  Right-click REVENUE on Marks → Format.
  → Numbers → Currency → ₹ → 0 decimal places.

Step 5 — Add conditional colour (highlight table):
  Drag REVENUE to the Color shelf as well as Text shelf.
  → Cells are shaded by value: high = dark, low = light.
  → This is called a highlight table.

Step 6 — Sort rows:
  Right-click PRODUCT_CATEGORY → Sort → Descending
  by SUM(Revenue).

EVIKA Revenue by Product & Month — Text Table Example

ProductJanFebMarAprMayJunTotal
P01 Laptop₹45K₹38K₹52K₹41K₹48K₹55K₹2,79K
P02 Monitor₹22K₹18K₹24K₹20K₹25K₹28K₹1,37K
P03 USB Hub₹8K₹7K₹9K₹8K₹10K₹11K₹53K
P04 Keyboard₹12K₹10K₹14K₹11K₹13K₹15K₹75K
P05 Mouse₹6K₹5K₹7K₹6K₹7K₹8K₹39K
Grand Total₹93K₹78K₹1,06K₹86K₹1,03K₹1,17K₹5,83K

Key Points

  • ✓Pie charts work for 2–5 categories with clearly different proportions. With 6+ categories or similar slice sizes, switch to a horizontal bar chart.
  • ✓Treemaps show part-to-whole using area (size) and can encode a second measure through colour — far more information-dense than pie charts.
  • ✓Text tables are built by placing a dimension on Rows, another on Columns, and a measure on the Text shelf. Add totals via Analysis → Totals menu.
  • ✓A highlight table is a text table with the measure also on the Color shelf — it adds a heat-map layer, making high and low values immediately visible.
  • ✓Grand Totals in Tableau are computed from the visible data, not from a SUM of displayed cells — this matters when filters are active.

Tips

💡 Limit pie charts to 5 slices. Group everything below 5% of total into an "Other" category using an IF calculated field.
💡 In treemaps, always show labels — without labels, viewers cannot identify what each rectangle represents.
💡 For text tables in dashboards, fix the column width: right-click a column header → Column Width → set a pixel value. This prevents resizing when filters change.
💡 Use the highlight table instead of a plain text table whenever you want readers to quickly spot best and worst cells without reading every number.

FAQ

My pie chart has too many thin slices — how do I group small values?
Create a calculated field: IF SUM([Revenue]) / TOTAL(SUM([Revenue])) < 0.05 THEN "Other" ELSE [Product Category] END. Use this on the Color shelf instead of the original category field. All categories below 5% of total will merge into one "Other" slice.
How do I sort the rows in a text table by the grand total?
Right-click the row dimension on the Rows shelf → Sort → Sort By: Field → SUM(Revenue) → Descending. This sorts so the highest-revenue category appears at the top. Apply the same approach for column sorting.
Can I export a text table to Excel?
Yes — right-click anywhere in the text table view → Copy → Crosstab, then paste into Excel. Or: Worksheet menu → Export → Crosstab to Excel. This exports the displayed table with totals intact. For the full underlying data, use Data → View Data → Export All.
Practice Question

You need to show each product's share of total annual revenue. Your data has 8 product categories. Which chart type is most readable?

Pie chart — it is designed for part-to-whole
Treemap — handles 8 categories better than a pie
✅ Horizontal bar chart sorted descending — most readable for 8 categories
Text table with percentages — exact numbers instead of a visual
Explanation: With 8 categories, a horizontal bar chart sorted by revenue share is the most readable choice. Pie charts become hard to read beyond 5 categories because viewers struggle to compare similar angles. Treemaps work better than pies for 8+ categories but still require mental area estimation. A sorted bar chart lets readers compare lengths directly — the most accurate pre-attentive task humans perform.
← Maps & Geographical AnalysisBack to Tableau Index →
Want live Tableau training?
EVIKA Academy, Noida Sector 51 — hands-on projects, job-ready curriculum
Book a Free Demo →