Sub topic 14
Charting a Pivot Table
Prerequisites: you should know how to create a pivot table, select a range, and use the Google Sheets chart editor. You should also understand that a pivot table is a summary of source data. The chart displays the pivot table’s result, not the original rows.
Prepare the pivot table
Before inserting a chart, check that the pivot table answers one clear question. For example, a sales table might use:
| Pivot table area | Example |
|---|---|
| Rows | Product |
| Columns | Quarter |
| Values | SUM of Sales |
| Filter | Region |
The resulting table might show products down the rows, quarters across the columns, and sales totals in the cells. This layout works well for comparing products over time.
Keep labels short and make sure the value field has a useful name, such as “Total sales”. Remove unnecessary subtotals or grand totals if they would distract from the comparison.
Create the chart
- Select the useful part of the pivot table, including its row and column labels. Exclude notes, blank columns, and unwanted total rows.
- Select Insert > Chart.
- In the Chart editor, open Setup.
- Check the Data range. It should include the pivot table labels and value columns.
- Choose a chart type that matches the question.
| Question | Suitable chart |
|---|---|
| How do categories compare? | Bar or column chart |
| How does each category change across periods? | Line chart |
| How is one total divided among a few categories? | Pie or doughnut chart |
| How do two measures differ by category? | Combo chart |
If Sheets interprets the table incorrectly, use the Setup options. Turn Use row 1 as headers or Use column A as labels on or off as needed. Use Switch rows / columns when products and quarters appear in the wrong direction.
Control filters and updates
Pivot table filters change which rows or columns appear in the summary. The chart usually reflects those changes when its data range still covers the pivot output. After changing a filter, inspect the chart and its range in Setup.
If the pivot table grows beyond the selected range, edit the chart’s Data range to include the new output. A chart that uses a fixed range may omit newly added pivot rows or columns.
Exercise
Exercise
A pivot table lists months in rows, sales regions in columns, and total sales as values. You want to compare regions month by month. Which chart type and orientation should you try first?
Show answer
Try a line chart with months as the horizontal-axis labels and regions as separate series. If the regions appear on the axis instead, use Switch rows / columns.