[Expand]General Information
[Expand]WinForms Controls
[Expand]ASP.NET Controls and MVC Extensions
[Expand]ASP.NET Bootstrap Controls
[Expand]ASP.NET Core Bootstrap Controls
[Collapse]WPF Controls
  Prerequisites
 [Expand]What's Installed
 [Expand]Common Concepts
 [Expand]MVVM Framework
 [Collapse]Controls and Libraries
   Reporting
  [Expand]Data Grid
  [Expand]Ribbon, Bars and Menu
  [Expand]Charts Suite
  [Expand]Pivot Grid
  [Expand]Scheduler
  [Collapse]Spreadsheet
    Product Structure
   [Expand]Getting Started
   [Expand]Spreadsheet Document
    Supported Formats
   [Expand]Cell Basics
   [Expand]Formulas
    Defined Names
    Data Binding
    Data Validation
   [Expand]Data Presentation
   [Expand]Pivot Table Overview
   [Expand]Charting Overview
    Shapes
    Printing
    Protection
    Find and Replace
   [Expand]Mail Merge
   [Expand]Visual Elements
    Services
    Themes and Templates
   [Expand]Shortcuts
   [Collapse]Examples
    [Expand]Files
    [Expand]Workbooks
    [Expand]Worksheet
    [Expand]Rows and Columns
    [Expand]Cells
    [Expand]Formulas
    [Expand]Data Binding
    [Expand]Formatting Cells
    [Expand]Conditional Formatting
    [Expand]Group Data
    [Expand]Filter Data
    [Expand]Tables
    [Collapse]Pivot Tables
      How to: Create a Pivot Table
      How to: Refresh a Pivot Table
      How to: Change a Data Source for a Pivot Table
      How to: Move a Pivot Table
      How to: Clear or Remove a Pivot Table
      How to: Change the PivotTable Layout
      How to: Subtotal Fields in a Pivot Table
      How to: Display or Hide Grand Totals for a Pivot Table
      How to: Apply a Predefined Style to a Pivot Table
      How to: Apply a Custom Style to a Pivot Table
      How to: Control Style Options
      How to: Change the Summary Function for a Data Field
      How to: Apply a Custom Calculation to a Data Field
      How to: Create a Calculated Field
      How to: Create a Calculated Item
      How to: Sort Items in a Pivot Table
      How to: Filter Items in a Pivot Table
      How to: Group Items in a Pivot Table
    [Expand]Printing
    [Expand]Pictures
    [Expand]Shapes
    [Expand]Charts
    [Expand]Sparklines
    [Expand]Protection
    [Expand]Mail Merge
    [Expand]Cell Templates
    [Expand]Commands
    [Expand]Customization
  [Expand]Rich Text Editor
  [Expand]Tree List
  [Expand]Gauge Controls
  [Expand]Map Control
  [Expand]Layout Management
  [Expand]Windows Modern UI
  [Expand]Printing-Exporting
  [Expand]Data Editors
  [Expand]Navigation Controls
  [Expand]Spell Checker
  [Expand]Property Grid
  [Expand]PDF Viewer
  [Expand]TreeMap Control
  [Expand]Gantt Control
  [Expand]Diagram Control
  [Expand]Windows and Utility Controls
   Dialogs, Notifications and Panels
  [Expand]Scheduler (legacy)
 [Expand]Scaffolding Wizard
 [Expand]Localization
  Redistribution and Deployment
  Get More Help
 [Expand]API Reference
[Expand]Xamarin Controls
[Expand]Windows 10 App Controls
[Expand]Office File API
[Expand]Reporting
[Expand]Report and Dashboard Server
[Expand]Dashboard
[Expand]eXpressApp Framework
[Expand]CodeRush
[Expand]CodeRush Classic
[Expand]Cross-Platform Core Libraries
[Expand]Tools and Utilities
 End-User Documentation

How to: Filter Items in a Pivot Table

The Spreadsheet Control provides numerous ways to filter items in a pivot table. Different types of filters are available: you show or hide specific items, construct the filter expression to display item labels that meet the given criteria (Label Filters and Date Filters), or filter a field based on summary values in the data area (Value Filters).

The table below describes API members that allow you to apply a filter to a PivotTable field.

Member Description
PivotField.ShowSingleItem Displays the specified item in the PivotTable field.
PivotItem.Visible Specifies whether the current item is displayed in the field.
PivotTable.Filters Provides access to the collection of filters applied to a pivot table.
PivotFilterCollection.Add Applies a filter to the specified row or column field.
PivotFilterType Specifies the type of the filter to be applied to the PivotTable field.
PivotFilter Represents a filter applied to the PivotTable field.
PivotFilter.Field Returns the PivotTable field to which the current filter is applied.
PivotFilter.Value Returns the first filter criteria value.
PivotFilter.SecondValue Returns the second filter criteria value.
PivotFilter.MeasureField Returns the data field used by the current value filter.
PivotFilter.Top10Type Specifies the type of the "Top 10" value filter.

Select the task you wish to perform.

Expanded Show or Hide Specific Items

The following example uses a report filter to filter the entire pivot table to show sales data for the Northeastern region. Before using the report filter, make sure that the corresponding field is added to the report filter area of your PivotTable report.

Expanded Use a Label Filter

The following example demonstrates how to apply a label filter to the "Region" column field to display sales data only for the Southern region.

Tip

To perform more versatile filtering, you can use wildcard characters. The asterisk * matches any number of characters, while the question mark ? represents a single character. To filter labels containing a specific character, such as the asterisk, question mark or tilde, put the tilde (~) before it.

Expanded Use a Date Filter

The following example demonstrates how to apply a filter to the "Date" row field to show sales data for the second quarter.

Expanded Use a Value Filter

The following example demonstrates how to apply a value filter to the "Product" row field to display products whose total sales fall between $6000 and $13000.

Expanded Use a Top 10 Filter

A "Top 10" value filter allows you to display the specified number of top or bottom items in a field (PivotFilterType.Count), show the top or bottom values that contribute to the specified percent of the filtered field's grand total (PivotFilterType.Percent), or filter the top or bottom values that make up a specific sum (PivotFilterType.Sum).

The following example demonstrates how to apply the "Top 10" filter to the "Product" row field to display two products with the lowest total sales.

Expanded Use Multiple Filters per Field

To enable the capability to apply multiple filters to a single row or column field, set the PivotBehaviorOptions.AllowMultipleFieldFilters property to true. By default, this property is false and if you try to apply more than one filter to a PivotTable field, only the last specified filter will be applied.

Expanded Remove a Filter

  • Clear a specific filter

    You can remove a filter applied to a PivotTable field using one of the methods listed in the table below.

    Method Description
    PivotFilter.Delete Removes the current filter from the collection of filters applied to a pivot table.
    PivotFilterCollection.Remove Removes the specified filter from the collection of filters applied to a pivot table.
    PivotFilterCollection.RemoveAt Removes the filter at the specified index from the collection of filters applied to a pivot table.
    PivotField.ShowAllItems Redisplays all items in the specified PivotTable field.
  • Clear all filters

    To remove all filters applied to the row and column fields of the PivotTable report at once, use the PivotFilterCollection.Clear method.

Is this topic helpful?​​​​​​​