Popular Searches
Popular Course Categories
Popular Courses

Creating Pie Charts

Basic Data Visualization

Creating Pie Charts in Tableau

Topic: Data Visualization Using Tableau

Learning Objective: Understand pie charts, create pie charts in Tableau, display category-wise proportions, customize colors and labels, calculate percentages, apply filters, and use pie charts effectively in business dashboards.

Course Link: JustAcademy Tableau Training

Demo Link: Register for a Tableau Course Demo


1. Introduction to Pie Charts

A pie chart is a circular data visualization divided into slices or wedges. Each slice represents a category's contribution to the total value. The size or angle of each slice is proportional to its value relative to the whole.

In Tableau, pie charts are useful for displaying part-to-whole relationships, such as sales by product category, profit contribution by region, marketing expenses by channel, and customer distribution by segment.

Example

Suppose an organization has total sales of ₹1,00,000 across four product categories.

Category Sales Percentage of Total
Technology ₹40,000 40%
Furniture ₹30,000 30%
Office Supplies ₹20,000 20%
Accessories ₹10,000 10%
Total ₹1,00,000 100%

The pie chart represents each category as a slice of the entire circle. Technology occupies the largest slice because it contributes 40% of total sales, while Accessories occupies the smallest slice at 10%.

Why Are Pie Charts Important?

  • They help communicate how a total is divided among categories.
  • They make major contributors easy to identify when there are only a few categories.
  • They support simple business presentations and summary reports.
  • They can display category names, sales values, and percentages.
  • They help users understand the relative contribution of different business segments.

2. Understanding the Components of a Pie Chart

2.1 Whole Circle

The complete circle represents the total of the values included in the chart. When all included values are positive and valid, the slices collectively represent 100% of that total.

2.2 Slices or Wedges

Each slice represents the contribution of a category. A larger value produces a larger slice, while a smaller value produces a smaller slice.

2.3 Angle

The angle of a slice determines its proportion of the full circle. A complete circle contains 360 degrees.

Formula:

Slice Angle = (Category Value / Total Value) × 360°

Example: If a category contributes ₹25,000 out of ₹1,00,000, its slice angle is:

(25,000 / 1,00,000) × 360° = 90°

2.4 Color

Different colors distinguish the categories. For example, Technology, Furniture, and Office Supplies can each have a different color.

2.5 Labels

Labels display useful information such as the category name, sales amount, and percentage of total.

2.6 Legend

The legend explains the relationship between colors and categories. It is especially important when the pie chart contains several slices.

2.7 Tooltip

A tooltip appears when a user hovers over a slice. It can display detailed information such as category, sales, profit, and percentage contribution.


3. When Should You Use a Pie Chart?

Use a pie chart when the primary question is how a total is divided among a small number of categories.

Business Requirement Example Purpose
Sales distribution Sales by category Identify major sales contributors.
Marketing analysis Advertising budget by channel Understand budget allocation.
Customer analysis Customers by segment Show the share of each segment.
Financial reporting Expenses by department Explain spending distribution.
Inventory reporting Stock value by product type Show the composition of inventory value.
Order analysis Orders by shipping mode Display the share of each shipping mode.

When Should You Avoid Pie Charts?

  • Avoid using too many slices because similar values become difficult to compare.
  • Avoid pie charts when the main objective is to compare exact values across many categories.
  • Avoid using them to show changes over time across multiple periods.
  • Avoid presenting negative values as ordinary parts of a whole.
  • Avoid comparing several pie charts when the sizes and proportions are difficult to judge.

Best Practice: Tableau recommends using a small number of slices, ideally no more than five distinct values for a straightforward pie chart. If the categories are numerous or their values are close, a sorted bar chart is often easier to interpret.


4. Understanding Dimensions and Measures

To create a pie chart in Tableau, you generally need a dimension to define the slices and a numerical measure to determine their sizes.

4.1 Dimensions

Dimensions are fields used to group or categorize data. Examples include Category, Region, Segment, Product Name, Department, and Ship Mode.

In a pie chart, a dimension placed on Color typically creates separate slices for its distinct members.

4.2 Measures

Measures are quantitative fields that can be aggregated. Examples include Sales, Profit, Quantity, Revenue, and Expenses.

In a pie chart, a numerical measure placed on Angle determines the relative size of each slice.

4.3 Example of Field Placement

Tableau Field Marks Card Property Purpose
Category Color Creates a differently colored slice for each category.
Sales Angle Determines the proportion represented by each slice.
Category Label Displays category names on the chart.
Sales Label Displays sales values when required.
Sales Size Controls the overall size of the pie when used as a size encoding.
Region Tooltip or Detail Adds extra information to the marks.

5. Preparing Data for a Pie Chart

Before creating a pie chart, make sure the dataset contains the categories and numerical values you want to compare.

Example Dataset

Category Region Sales Profit
Technology West 40000 8000
Furniture West 30000 5000
Office Supplies West 20000 4000
Accessories West 10000 2000

Data Preparation Checklist

  • Verify that the category field is recognized as a dimension.
  • Confirm that the measure is numeric.
  • Check missing values and unexpected records.
  • Choose the correct measure for the analysis.
  • Check whether the measure should use SUM, AVG, COUNT, or another aggregation.
  • Confirm whether filters should apply to the total represented by the pie chart.

Important: Make sure the total represents the intended population. For example, a pie chart showing category-wise sales after a date filter represents the distribution of sales within that selected date range, not necessarily all-time sales.


6. Step-by-Step: Creating a Basic Pie Chart in Tableau

Step 1: Open Tableau

Launch Tableau Desktop or a supported Tableau authoring environment. Connect to a dataset containing a category field and a numerical measure.

Step 2: Open a Worksheet

Create a new worksheet. Locate the Data pane, where dimensions and measures are listed.

Step 3: Select the Pie Mark Type

On the Marks card, open the mark type drop-down menu and select Pie. You can also use Show Me to select a pie chart after selecting suitable fields.

Step 4: Add a Category to Color

Drag Category from the Data pane to Color on the Marks card. Tableau creates separate slices for the category members included in the view.

Step 5: Add a Measure to Angle

Drag Sales to Angle on the Marks card. Tableau calculates the slice sizes according to the aggregated sales values.

Step 6: Add Category Labels

Drag Category to Label on the Marks card to show the names of the categories.

Step 7: Add Sales Values

If the values are useful, drag Sales to Label as well. Review the labels to make sure they do not overlap.

Step 8: Adjust the Pie Size

Click Size on the Marks card and move the slider to make the pie chart larger or smaller.

Step 9: Format Colors and Tooltips

Choose clear colors for the categories and customize the tooltip to display relevant details.

Step 10: Rename the Worksheet

Give the worksheet a descriptive name, such as Sales Distribution by Category.

Basic Pie Chart Configuration

Tableau Area Field or Setting Purpose
Marks Pie Sets the mark type.
Color Category Separates categories into slices.
Angle SUM(Sales) Controls each slice's proportion.
Label Category and Sales Displays useful information.
Size Size slider Adjusts the overall pie size.

7. Creating a Pie Chart Using Show Me

Tableau's Show Me feature provides a quick way to select a suitable chart type based on the selected fields.

Procedure

  1. Open a worksheet and connect to your data.
  2. Select a dimension such as Category.
  3. Select a measure such as Sales.
  4. Open Show Me from the toolbar.
  5. Select the pie chart icon.
  6. Inspect the Marks card to verify the mark type and field placements.
  7. Adjust the size, colors, labels, and tooltips.

Depending on the fields selected, Tableau may place the measure on Angle and Size and place the dimension on Color. Review these settings rather than assuming the automatically generated chart is already configured exactly as needed.


8. Creating a Pie Chart of Sales by Category

This example shows the contribution of each product category to total sales.

Procedure

  1. Connect to the Sample - Superstore dataset or a similar sales dataset.
  2. Open a new worksheet.
  3. Select Pie from the Marks card.
  4. Drag Category to Color.
  5. Drag Sales to Angle.
  6. Drag Category to Label.
  7. Optionally drag Sales to Label to show the values.
  8. Format the sales values as currency.
  9. Review the legend and title.

Business Questions Answered

  • Which category contributes the largest share of sales?
  • Which category contributes the smallest share?
  • How is the total sales value distributed?
  • Are a few categories responsible for most of the sales?

Interpretation: The largest slice represents the category with the highest aggregated sales among the categories included in the view. The chart displays relative contribution, so exact values or percentages should be added when users need precise comparisons.


9. Calculating Percentage of Total

Percentage of total expresses a category's value as a percentage of the total value represented in the view.

Formula

Percentage of Total = (Category Value / Total Value) × 100

Example

If Technology sales are ₹40,000 and total sales are ₹1,00,000:

Percentage of Total = (40,000 / 1,00,000) × 100 = 40%

Method 1: Use a Quick Table Calculation

  1. Create a pie chart with Category on Color and Sales on Angle.
  2. Drag Sales to Label if you want to display a value on the slice.
  3. Open the menu for the Sales pill used for the label.
  4. Select Quick Table Calculation and then Percent of Total.
  5. Check the calculation's addressing and partitioning so that the percentages are calculated across the intended categories.
  6. Format the result as a percentage.

Important: When using a quick table calculation, ensure it is applied to the correct copy of the measure. If Sales controls Angle, keep that field's aggregation appropriate for the slice sizes; use the label calculation for percentage display when needed.

Method 2: Create a Calculated Field

For a basic category-level percentage calculated against the total in the current filtered view, a table calculation can be used. Create a calculated field with the following expression:

SUM([Sales]) / TOTAL(SUM([Sales]))

Name the field Sales Percentage of Total, then use it on Label and format it as a percentage. Configure the table calculation to compute across the category marks as intended.

The result depends on the view's dimensions, filters, and table-calculation settings. Test the calculation when you change the level of detail or add additional dimensions.


10. Creating a Pie Chart for Profit by Region

This chart helps compare each region's contribution to total profit.

Procedure

  1. Set the Marks card to Pie.
  2. Drag Region to Color.
  3. Drag Profit to Angle.
  4. Drag Region to Label.
  5. Optionally display Profit and Percentage of Total on the labels.
  6. Review the values to determine whether negative profit exists.

Important: Ordinary pie charts are intended for positive parts of a whole. If some regions have negative profit, a pie chart may be misleading or unsuitable. Use a bar chart to compare positive and negative profit across regions.


11. Creating a Pie Chart with Multiple Dimensions

A pie chart can display one dimension as slices and provide additional information through labels, tooltips, or detail.

Example: Sales by Category and Region

  1. Set the Marks card to Pie.
  2. Place Category on Color.
  3. Place Sales on Angle.
  4. Place Region on Tooltip or Detail, depending on the intended level of detail.
  5. Inspect the result to verify whether Tableau has split the marks or changed the level of detail.

If you need separate pie charts for different regions, place Region on Rows or Columns, or use it as a pane-defining dimension. Each pane can then display the category distribution for its region.

Best Practice: Keep the chart focused. Too many dimensions can produce multiple small pie charts or a large number of slices, making comparisons difficult.


12. Creating Multiple Pie Charts

Multiple pie charts, sometimes called small multiples, allow users to compare category distributions across groups such as regions, years, or customer segments.

Procedure: Category Distribution by Region

  1. Set the Marks card to Pie.
  2. Drag Category to Color.
  3. Drag Sales to Angle.
  4. Drag Region to Rows or Columns.
  5. Drag Category to Label if the slices can accommodate readable labels.
  6. Adjust the size and layout of the charts.
  7. Check that users can distinguish the categories consistently across the pies.

Potential Benefits

  • Compare the composition of sales across regions.
  • Identify categories that contribute strongly in specific regions.
  • Inspect how the distribution differs among customer segments.

Limitation: Comparing slice angles across several separate pies can be difficult. A 100% stacked bar chart or grouped bar chart may communicate the differences more clearly.


13. Formatting Pie Chart Colors

Colors distinguish categories and help users connect the slices to the legend.

Procedure

  1. Click Color on the Marks card.
  2. Select Edit Colors when available.
  3. Choose a suitable color palette.
  4. Assign category colors consistently.
  5. Check that the selected colors are easy to distinguish.

Color Best Practices

  • Use a limited set of distinguishable colors.
  • Keep the same category colors across related worksheets.
  • Avoid using similar shades for categories that need to be compared.
  • Consider color accessibility.
  • Do not rely on color alone when category labels can add clarity.
  • Keep the legend visible when it is necessary to understand the chart.

14. Adding Labels to a Pie Chart

Labels make the pie chart easier to understand by displaying category names, values, or percentages directly on the slices.

Procedure

  1. Open the Marks card.
  2. Click Label.
  3. Enable mark labels.
  4. Drag the required fields to Label, such as Category, Sales, or Sales Percentage of Total.
  5. Format the numbers and percentages.
  6. Review the chart for overlapping labels.

Recommended Label Formats

Label Type Example Use
Category Technology Identifies the slice.
Value ₹40,000 Shows the amount contributed.
Percentage 40% Shows the relative contribution.
Combined Technology - 40% Shows category and contribution.

Labeling Best Practices

  • Use concise labels.
  • Display percentages when part-to-whole comparison is the main goal.
  • Avoid showing too much information inside each slice.
  • Use tooltips for additional details.
  • For small slices, use the legend or tooltip rather than forcing labels to overlap.

15. Adjusting the Size of a Pie Chart

The Size property controls the overall size of the pie mark. Increasing the size can make the chart easier to read, while decreasing it can help fit the chart into a dashboard.

Procedure

  1. Click Size on the Marks card.
  2. Move the slider to increase or decrease the pie size.
  3. Use the Fit menu to adjust how the view occupies the available worksheet space.
  4. Review the labels, legend, and layout after resizing.

For a simple pie chart, Size changes the overall pie dimensions rather than the percentage contribution represented by each slice. Angle determines the relative size of the slices.


16. Using Filters with Pie Charts

Filters allow users to analyze the distribution of categories within a selected subset of the data.

Example: Sales Distribution by Region

  1. Create a pie chart with Category on Color and Sales on Angle.
  2. Drag Region to the Filters shelf.
  3. Select the required region or regions.
  4. Show the filter if users need to change the selection interactively.
  5. Test different selections.
  6. Verify that percentages reflect the intended total after filtering.

Useful Filters

Filter Purpose
Order Date Show category contributions within a selected period.
Region Focus on selected geographical areas.
Category Include only selected categories.
Segment Analyze a customer segment.
Product Name Focus on specific products, although too many products may make the pie unsuitable.

Important: A filter can change the total used for percentage calculations. Check the intended denominator before presenting the chart.


17. Creating a Pie Chart in a Dashboard

A Tableau dashboard combines worksheets into a single interactive view. A pie chart can be used to summarize the contribution of categories alongside other visualizations.

Procedure

  1. Create a worksheet named Sales Distribution by Category.
  2. Build a pie chart with Category on Color and Sales on Angle.
  3. Add appropriate labels and tooltips.
  4. Create a new dashboard.
  5. Drag the pie chart worksheet onto the dashboard.
  6. Add supporting charts, such as a monthly sales line chart or a sales-by-region bar chart.
  7. Add relevant filters.
  8. Test the dashboard to confirm that the filters and actions work as intended.

Example Dashboard Layout

Dashboard Element Visualization Purpose
Sales Distribution Pie chart Shows each category's contribution.
Monthly Sales Line chart Shows sales trends over time.
Regional Performance Bar chart Compares sales across regions.
Filters Date and Region filters Allows focused analysis.

18. Pie Charts Versus Bar Charts

Although pie charts are useful for showing simple proportions, bar charts are often better for comparing category values accurately.

Feature Pie Chart Bar Chart
Main purpose Part-to-whole relationships Comparing values across categories
Best number of categories Small number Can handle more categories with suitable sorting and layout
Exact value comparison Can be difficult Usually easier
Negative values Generally unsuitable Can display positive and negative values
Showing change over time Usually unsuitable Bars can compare periods, while a line chart often shows trends more clearly
Percentage contribution Visually intuitive for a few categories Can also show percentages through labels or a 100% stacked chart

Rule of Thumb: Use a pie chart when the main question is "What share of the total does each category represent?" Use a bar chart when the main question is "Which category is larger, and by how much?"


19. Common Mistakes When Creating Pie Charts

Mistake Why It Is a Problem Solution
Too many slices The chart becomes difficult to read. Group minor categories where appropriate or use a bar chart.
Wrong measure on Angle The slices do not represent the intended values. Place the correct numerical measure on Angle.
Category not on Color The pie may not split into the intended categories. Place the dimension on Color.
Confusing colors Users cannot easily identify categories. Choose distinguishable colors and a clear legend.
Too many labels Labels overlap or become unreadable. Show selected labels and use tooltips.
Incorrect percentage calculation Values may not sum to the intended 100%. Check the calculation and table-calculation settings.
Negative values A standard pie chart does not represent negative contributions appropriately. Use a bar chart or another suitable visualization.
Comparing many pies Comparing slice angles between charts is difficult. Consider a 100% stacked bar chart.
Missing data The displayed total may not reflect the intended population. Investigate null values and data filters.
Unclear title The viewer does not know what the whole represents. Use a title that identifies the measure and context.

20. Practical Project: Sales Distribution Dashboard

Project Objective: Create a Tableau dashboard showing the percentage contribution of product categories to total sales, with filters for region and date.

Required Fields

  • Category
  • Sales
  • Profit
  • Region
  • Order Date
  • Segment

Part A: Create the Pie Chart

  1. Connect to a sales dataset.
  2. Open a new worksheet.
  3. Set the Marks card to Pie.
  4. Drag Category to Color.
  5. Drag Sales to Angle.
  6. Drag Category to Label.
  7. Add a percentage-of-total label if required.
  8. Adjust colors and size.

Part B: Add a Region Filter

  1. Drag Region to Filters.
  2. Select the desired regions.
  3. Show the filter for interactive use.
  4. Test the chart with different regions.

Part C: Add a Date Filter

  1. Drag Order Date to Filters.
  2. Choose an appropriate date-filter type.
  3. Select a time range.
  4. Verify that the chart reflects sales within the selected range.

Part D: Create a Supporting Bar Chart

  1. Create a second worksheet.
  2. Place Category on Rows.
  3. Place Sales on Columns.
  4. Sort categories by sales.
  5. Show value labels if they improve readability.

Part E: Build the Dashboard

  1. Create a new dashboard.
  2. Add the pie chart and supporting bar chart.
  3. Include the region and date filters.
  4. Add a descriptive dashboard title.
  5. Test the filters and review the visual layout.

Expected Outcome

The dashboard should show the relative contribution of each category and provide a bar chart for more precise value comparisons. Users should be able to filter the results by region and date.

Business Questions to Answer

  • Which category contributes the largest share of sales?
  • Which category contributes the smallest share?
  • Does the category distribution change across regions?
  • Does the distribution change when a different date range is selected?
  • Do the categories with the largest sales also generate the largest profits?

21. Best Practices for Pie Charts in Tableau

  • Use a pie chart only when showing parts of a meaningful whole.
  • Keep the number of slices small.
  • Use a dimension on Color and a suitable measure on Angle.
  • Check the measure's aggregation before interpreting the slices.
  • Use category labels or a clear legend.
  • Show percentages when relative contribution is important.
  • Use accessible and distinguishable colors.
  • Keep tooltips concise and informative.
  • Verify that filters produce the intended total.
  • Avoid standard pie charts when the data contains negative contributions.
  • Use bar charts when exact comparisons are more important than part-to-whole presentation.
  • Test the visualization before publishing a dashboard.

22. Interview Questions and Answers

Q1. What is a pie chart in Tableau?

Answer: A pie chart is a circular visualization divided into slices that represent categories' proportions of a total. Slice size is determined by the values used on Angle.

Q2. When should you use a pie chart?

Answer: Use it to show the contribution of a small number of categories to a whole, such as sales by category or expenses by department.

Q3. How do you create a pie chart in Tableau?

Answer: Select Pie on the Marks card, drag a dimension to Color, and drag a numerical measure to Angle. Add labels and format the chart as required.

Q4. What is the purpose of the Angle property?

Answer: Angle determines the proportion represented by each pie slice. A larger aggregated value generally produces a larger slice when the values are appropriate for a part-to-whole chart.

Q5. What is the purpose of Color in a pie chart?

Answer: Color distinguishes the category members that make up the pie slices.

Q6. How can you display percentages on a pie chart?

Answer: Use a Percent of Total quick table calculation on an appropriate copy of the measure, or create a calculated field using a suitable table calculation. Configure the calculation to compute across the intended categories and format the result as a percentage.

Q7. What is the difference between Angle and Size?

Answer: Angle controls the relative size of each slice within the pie. Size controls the overall dimensions of the pie mark.

Q8. Can you display multiple pie charts in Tableau?

Answer: Yes. Place a grouping dimension, such as Region, on Rows or Columns to create separate pie charts for each group.

Q9. Why should you avoid too many slices?

Answer: Many slices make it difficult to compare proportions, distinguish colors, and read labels. A bar chart is often a better alternative for many categories.

Q10. Can a pie chart represent negative profit?

Answer: A standard pie chart is generally unsuitable for showing negative values as parts of a whole. A bar chart can represent both positive and negative profit more clearly.

Q11. What is Show Me in Tableau?

Answer: Show Me is a Tableau feature that recommends or creates chart types based on selected fields and the data available in the view.

Q12. How do filters affect a pie chart?

Answer: Filters change which records contribute to the chart. This can change both slice values and the total used to calculate percentages.

Q13. How do you change the colors of pie slices?

Answer: Use Color on the Marks card and select Edit Colors when available to choose a palette or assign colors to categories.

Q14. What is the difference between a pie chart and a bar chart?

Answer: A pie chart emphasizes contribution to a whole, while a bar chart is usually better for comparing exact values across categories.

Q15. Can pie charts be used in dashboards?

Answer: Yes. Pie charts can be placed in Tableau dashboards with other worksheets and filters to support interactive analysis.


23. Practice Exercises

Exercise 1: Sales by Category

Create a pie chart displaying sales by category. Identify the largest and smallest slices.

Exercise 2: Profit Distribution

Create a pie chart showing profit contribution by category, provided that the values are appropriate for a part-to-whole visualization. If the data contains negative profit values, create a bar chart instead and explain why.

Exercise 3: Percentage Labels

Add percentage-of-total labels to a pie chart. Confirm that the percentages sum to approximately 100% for the included categories, allowing for rounding.

Exercise 4: Regional Analysis

Create separate pie charts for different regions and compare the category distributions.

Exercise 5: Interactive Filters

Add date and region filters. Test different selections and explain how the proportions change.

Exercise 6: Chart Comparison

Create both a pie chart and a bar chart for the same sales data. Explain which chart makes it easier to identify the largest category and compare exact values.

Exercise 7: Dashboard Development

Create a dashboard containing a category sales pie chart, a category sales bar chart, and at least one interactive filter.


24. Quick Revision Notes

  • Pie chart: Shows how a whole is divided among categories.
  • Slice: Represents one category's contribution.
  • Angle: Determines each slice's proportion.
  • Color: Distinguishes categories.
  • Label: Displays category names, values, or percentages.
  • Size: Adjusts the overall size of the pie mark.
  • Dimension: Commonly defines the category slices.
  • Measure: Supplies the numerical values used to size the slices.
  • Percentage of Total: Expresses a category's value as a percentage of the relevant total.
  • Filter: Changes the records included in the visualization.
  • Show Me: Helps select a suitable chart type.
  • Marks card: Controls the mark type and visual properties.
  • Best practice: Use a small number of slices and clear labels.
  • Alternative: Use a bar chart for precise comparisons across many categories.

25. Final Checklist

  • Understand the purpose of a pie chart.
  • Connect to the correct data source.
  • Verify the category dimension and numerical measure.
  • Select Pie on the Marks card.
  • Place the category on Color.
  • Place the measure on Angle.
  • Add relevant labels and tooltips.
  • Format colors and adjust the overall size.
  • Calculate percentages correctly when required.
  • Test the chart with filters.
  • Confirm that the data is suitable for a part-to-whole chart.
  • Use a bar chart if the pie chart becomes crowded or misleading.

26. Conclusion

Pie charts in Tableau help users understand the composition of a total by displaying the relative contributions of different categories. By placing a dimension on Color and a numerical measure on Angle, you can create a basic pie chart and customize it with labels, percentages, tooltips, and filters.

For effective business reporting, keep the number of slices small, verify the aggregation and percentage calculations, and choose a bar chart when exact comparisons or many categories are involved.

Learn More

whatsapp