Sub topic 1
Filtering a PivotTable: Report Filters and Field Drop-Downs
Slicers and timelines build on the two older filtering tools in a PivotTable: report filters and field drop-down filters. This chapter explains how both work, what they have in common, and where they fall short. Those limits are the reason slicers and timelines exist.
Prerequisites
This chapter assumes you can do the following:
- Create a basic PivotTable from a range or an Excel Table.
- Drag fields into the Rows, Columns, Values, and Filters areas of the PivotTable Fields pane.
- Tell text values from true date values in worksheet cells.
- Find commands on the ribbon, including the contextual PivotTable Analyze and Design tabs. These tabs appear only while a cell inside a PivotTable is selected.
The examples use a sales table with the columns Region, Product, Salesperson, OrderDate, and Amount. The PivotTable puts Product in Rows and the sum of Amount in Values.
The working model: filtering hides items, not data
A PivotTable summarizes a source range or Table. A filter does not delete or change source rows. It tells the PivotTable which items of a field to include when it recalculates. An item is one distinct value of a field. In the Region field, "East", "West", and "North" are items.
Every filter you apply is stored in the PivotTable itself. If you filter Region to East, totals, subtotals, and grand totals all recalculate for East only. The source data stays intact, and clearing the filter restores the full results.
Excel offers several filtering tools. This chapter covers two of them:
| Tool | Where it lives | Filters by |
|---|---|---|
| Report filter | Filters area, shown above the PivotTable | Items of one field, which need not appear in Rows or Columns |
| Field drop-down | Arrow on a Row Labels or Column Labels header | Items, labels, values, dates, or a search term |
Slicers and timelines are covered in later chapters.
Report filters
A report filter is a field placed in the Filters area of the PivotTable Fields pane. Excel shows it in cells above the PivotTable as a label with a drop-down arrow. The label reads "Region" and the cell next to it reads "(All)".
Adding a report filter
- Click any cell inside the PivotTable.
- In the PivotTable Fields pane, drag Region into the Filters area.
- Find the new "Region" and "(All)" cells above the PivotTable.
- Click the arrow next to "(All)" and choose East.
The PivotTable now shows only East sales. Region does not need to be in Rows or Columns, so you can filter on a field without adding a column to the layout.
Selecting several items
By default, a report filter allows one item at a time. To pick more than one:
- Open the drop-down.
- Tick Select Multiple Items.
- Tick the items you want, for example East and West.
- Click OK.
The cell next to the label then reads "(Multiple Items)". It does not say which items are selected. A reader who sees only the printed report cannot tell which regions are included, and this is the biggest weakness of report filters.
Arranging several report filters
You can place several fields in the Filters area. Excel stacks them vertically above the PivotTable, one field per row. To lay them out side by side, open PivotTable Analyze > Options > Options and set Display to Over, Then Down or Down, Then Over. You can also set how many filters appear in each row or column.
Show Report Filter Pages
A report filter has one more feature. Select the PivotTable, then choose PivotTable Analyze > Options > Show Report Filter Pages. Choose the filter field, and Excel creates one new worksheet per item. Each sheet holds a copy of the PivotTable filtered to that item. This is useful for producing a separate sheet for each region. The copies do not stay in sync with the original, so refreshing the data later means refreshing each sheet.
Field drop-down filters
Every field in Rows or Columns has an arrow in its header cell, for example "Row Labels". The arrow opens the field drop-down filter. It is more powerful than a report filter because it offers several filter types in one menu.
The item list and search box
The menu shows a search box and a list of every item with a check box. The search box narrows the list as you type. Typing "ne" in the Product field shows only items that contain "ne".
To filter by specific items, tick or clear the check boxes and click OK. A funnel icon replaces the arrow on the header to show that the field is filtered. Clearing the filter is done from the same menu with Clear Filter From "Product".
Label Filters
Label Filters compare the item names themselves. They are available for fields in Rows or Columns. The options include:
- Equals and Does Not Equal
- Begins With and Ends With
- Contains and Does Not Contain
- Greater Than, Less Than, and Between, which compare alphabetically
For a text field, "Begins With" A keeps every product whose name starts with A.
Value Filters
Value Filters compare the numbers in the Values area. They answer questions such as "which products sold more than 10,000?" The options include:
- Equals, Greater Than, Less Than, and Between
- Top 10, which despite its name lets you choose any number, any percent, or any sum
A Top 10 filter on Product by Sum of Amount, set to the top 5 items, keeps the five best-selling products. If you change the source data and refresh, the filter is re-evaluated, so the top five may be different products.
Date Filters
If the field holds true date values, the menu offers Date Filters such as This Month, Last Quarter, Next Year, and Between. Excel computes these relative to the current system date. A filter for "This Month" gives different results next month without any change from you.
Date Filters appear only when Excel recognizes the field as dates. Dates stored as text will not get this option. This matters again when you prepare a date field for a timeline.
One filter type per field
A single field can have only one type of filter active at a time. If you apply a Label Filter and then a Value Filter to the same field, the Value Filter replaces it. The check-box selection is also affected. The Manual Filter, which is the check-box selection, can be combined with a Label, Value, or Date filter only if you tick Allow multiple filters per field. You set this in PivotTable Analyze > Options > Options > Totals & Filters.
How the two tools differ
The two tools often produce the same numbers but behave differently.
| Question | Report filter | Field drop-down |
|---|---|---|
| Needs the field in Rows or Columns? | No | Yes |
| Shows the current selection on the sheet? | Only for one item | No, only a funnel icon |
| Supports Top 10 and label rules? | No | Yes |
| Easy to link to several PivotTables? | Only by repeating the setup | No |
The filter's state is part of the PivotTable. A field drop-down filter on one PivotTable does not affect another PivotTable, even when both use the same data.
Limits that motivate slicers and timelines
Both tools work, but each has weaknesses that show up in shared reports and dashboards:
- Hidden state. Several selected items appear as "(Multiple Items)" or only as a funnel icon. You must open the menu to see what is filtered.
- Menu-driven. Every change takes at least two clicks: open the menu, then pick an item. Comparing East against West means opening the drop-down twice.
- One PivotTable at a time. A filter applies only to the PivotTable it belongs to. If a report has three PivotTables, you must set the same filter three times.
- Awkward date handling. Date Filters are relative and rule-based. Choosing an arbitrary range, such as 12 March to 9 June, needs a Between filter and typed dates.
These limits explain the design of the controls that follow. A slicer shows every item as a button, so the selection is always visible. A timeline gives dates a draggable scale. Both can drive several PivotTables at once through Report Connections.
Common errors
- No Date Filters option. The field contains text that looks like dates. Convert the source column to true dates and refresh the PivotTable.
- Report filter shows "(All)" but totals look small. Another field in the PivotTable has a filter on it. Look for funnel icons on row and column headers.
- A new item does not appear in the filter. The source range has grown, but the PivotTable has not been refreshed. Use PivotTable Analyze > Refresh. If the source is a plain range, expand it or convert it to an Excel Table.
- A filtered-out item still appears in a list. A Label or Value filter may have been replaced by another filter type on the same field. Open the menu and check which filter is active.
- Grand total differs from the visible rows. By default, the grand total includes only items that pass the filter, but with manual filtering of a field the total can include or exclude filtered items depending on the Include filtered items in set totals option, which applies mainly to OLAP data sources. For a standard worksheet source, the grand total reflects the visible items.
Summary
A report filter picks items from a field that sits above the PivotTable. A field drop-down filter works on fields in Rows or Columns and adds label, value, and date rules. Both store their state inside one PivotTable, hide which items are selected, and require menu navigation. The next chapters introduce slicers and timelines, which address those limits.
Exercise
A PivotTable has Product in Rows and a report filter on Region showing "(Multiple Items)". Name two ways this differs from a field drop-down filter on Product, and give one reason a report with three PivotTables is tedious to filter this way.
Show answer
First, the report filter works on Region even though Region is not in Rows or Columns, while the Product drop-down needs Product in Rows or Columns. Second, the drop-down supports Label, Value, and Top 10 filters, while the report filter only selects items. Each filter belongs to one PivotTable, so you must set the same Region selection separately on all three PivotTables. The "(Multiple Items)" label also hides which regions are selected.
Exercise
You apply a Value Filter (Top 10, top 3 by Sum of Amount) to the Product field. Next month you refresh after adding new sales data. Will the same three products always appear? Explain.
Show answer
No. The filter is a rule, not a fixed list of items. Excel re-evaluates it on refresh, so the three products with the highest sums in the updated data appear, which may differ from last month's three.