[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
  [Collapse]Pivot Grid
   [Expand]Getting Started
   [Expand]Fundamentals
   [Expand]Binding to Data
   [Collapse]Data Shaping
    [Collapse]Aggregation
     [Expand]Summaries
      Totals
      Aggregation Levels
     Grouping
    [Expand]Sorting
    [Expand]Filtering
    [Expand]Data Formatting
   [Expand]Data Analysis
   [Expand]Layout
   [Expand]Printing and Exporting
   [Expand]End-User Interaction
   [Expand]Appearance
   [Expand]MVVM Enhancements
   [Expand]UI Elements
   [Expand]End-User Capabilities
   [Expand]Examples
  [Expand]Scheduler
  [Expand]Spreadsheet
  [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]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

Totals

The Pivot Grid calculates summary values (totals) and displays them as additional columns or rows. The following totals are supported:

Expanded Automatic Totals

The automatic totals can be divided into two types:

  • Row/column totals display sub-totals calculated for outer row/column fields.
  • Row/column grand totals display summary totals calculated against all the rows/columns.

The automatic totals are calculated using a summary function the corresponding data field specifies.

The table below lists the common members that configure automatic totals:

Member Description
PivotGridField.ShowTotals Gets or sets whether automatic totals that correspond to the current data field are visible. This is a dependency property.
PivotGridControl.ShowRowTotals Gets or sets whether to display Row Totals.
PivotGridControl.ShowColumnTotals Gets or sets whether to display Column Totals.
PivotGridControl.ColumnTotalsLocation Gets or sets the column totals' location.
PivotGridControl.RowTotalsLocation Gets or sets the location of row totals. This is a dependency property.
PivotGridControl.ShowColumnGrandTotals Gets or sets whether to display Row Grand Totals.
PivotGridControl.ShowRowGrandTotals Gets or sets whether to display row grand totals.
PivotGridControl.ShowTotalsForSingleValues Gets or sets whether automatic totals are displayed for the field values which contain a single nesting field value.

Use custom totals to calculate totals using a different summary function, or to calculate multiple subtotals.

Expanded Custom Totals

You may need to manually specify how many and what type of totals to display for each field. The custom totals replace automatic totals and can be calculated using various aggregation functions like Sum, Min, Max, Average, etc. The number of totals depends on how many items you add to the field's custom total collection.

For example, the image below shows the Category field displaying Sum and Max totals:

The code below creates the layout as in the image above:

You can set the same layout in XAML as well:

The following table lists the members you can use to configure custom totals:

Member Description
PivotGridField.TotalsVisibility Gets or sets whether to display totals for the current field when it is in the Column Header Area or Row Header Area and if so, whether they are automatic or custom. This is a dependency property.
PivotGridField.CustomTotals Gets the current field's custom total collection.
PivotGridField.SummaryType Gets or sets the type of the summary function which is calculated against the current data field. This is a dependency property.

Expanded Running Totals

Running totals allow you to calculate cumulative values that correspond to the specified column or row fields. For instance, in the PivotGridControl below, running totals are enabled for the Quarter field:

In the result, the PivotGrid control in the image below displays cumulative sales for each quarter over a two-year period:

Note that cumulative values depend on the values' order. End-users can change the order using sorting, grouping or filtering.

You can specify whether running totals are calculated independently within individual groups, or for the entire PivotGrid. In the image below, running totals for the Quarter field are calculated independently for each year (cross-group variation is disabled):

The table below lists the members you can use to configure running totals:

Member Description
PivotGridField.RunningTotal Gets or sets whether Running totals are calculated for values in the Data Area that correspond to the current column or row field. This is a dependency property.
PivotGridControl.AllowCrossGroupVariation Gets or sets whether summary variations and running totals are calculated independently within individual groups, or throughout the Pivot Grid. This is a dependency property.

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