Pivot Table Issues

How to Create a Custom Grand Total in Power Pivot

Algirdas JasaitisAlgirdas Jasaitis Nov 3, 2026 869 views

Question details

The user needs to correct a Power Pivot report where the Grand Total recalculates over the entire source table instead of summing the visible row-level results, and resolve errors caused by empty tables.

How to Create a Custom Grand Total in Power Pivot
Product
Microsoft Excel (Power Pivot)
Device & OS
not provided
Scenario
Calculating custom totals in a Power Pivot report where default grand totals are incorrect due to row-level DAX calculations.
Observed behavior
The Power Pivot report calculates row-level differences correctly but returns an unexpected Grand Total. Calculation errors also occur when evaluating empty tables or blank rows.
Before you start

Ensure your Data Model is properly established and that columns like Order Quantity and Available Qty are formatted as numeric data types before writing your DAX measures.

Solution 1Recommended

Use SUMX for Iterative DAX Calculations

Use the SUMX function to force Power Pivot to iterate over the visible dimension values instead of calculating the grand total in a single lump sum.

By default, Power Pivot evaluates the Grand Total by applying your DAX measure over the entire unfiltered dataset. The SUMX function forces the engine to calculate row-by-row and sum those individual results.

1
Open Measure Settings

Select your Power Pivot table, navigate to the Power Pivot tab on the ribbon, and click on Measures to create a New Measure.

2
Write the SUMX Formula

Create a new measure using the SUMX function to iterate over your table. For example, use SUMX(VALUES(Table1[Product]), [YourRowMeasure]) to evaluate each product individually.

3
Apply the Custom Measure

Add this new measure to your Pivot Table's Values area. The Grand Total will now accurately reflect the sum of the individual row calculations.

Use SUMX for Iterative DAX Calculations
Free Microsoft Office alternative

Try WPS Office for Streamlined Data Analysis

While advanced Data Modeling and complex DAX formulas are specific to Microsoft's Power Pivot, WPS Office provides a highly compatible, free alternative for standard spreadsheet tasks and conventional Pivot Tables, offering a seamless transition for daily data work.

  1. 1. Download and Install: Get WPS Office for free from the official website and install it on your device.
  2. 2. Open Your Spreadsheet: Launch WPS Spreadsheets and open your existing .xlsx files directly.
  3. 3. Create Pivot Tables: Select your data range, go to the Insert tab, and click Pivot Table to start analyzing your data.
High compatibility with Microsoft Excel (.xlsx) formatsPowerful standard Pivot Table features for quick data summarizationLightweight software that runs smoothly without heavy resource usageFamiliar interface ensuring a zero learning curve for Excel users
microsoft office alternative - wps office

Frequently Asked Questions

Why does my Power Pivot Grand Total not match the sum of the rows?

By default, Power Pivot evaluates the Grand Total by applying your DAX measure over the entire unfiltered dataset, rather than mathematically summing the individual row results. Using an iterative function like SUMX forces the system to calculate the measure row-by-row and sum those results.

How do I ensure my quantity columns are treated as numbers in DAX?

You can force a column to be evaluated as a number by wrapping the column reference in the VALUE() function within your DAX formula, or by changing the data type directly to a Whole Number or Decimal in the Data Model column properties.

What is the difference between SUM and SUMX in DAX?

SUM aggregates a single column across the current filter context. SUMX is an iterative function that evaluates an expression row by row over a specified table or filtered dataset, and then sums the calculated results, making it ideal for custom grand totals.