Calculate a Percentage from Multiple Counts in an Excel PivotTable
Question details
Calculate a PivotTable percentage by dividing a serviced count by a serial count when the PivotTable uses the Data Model.

- Product
- Microsoft Excel PivotTable and Power Pivot
- Device & OS
- not provided
- Scenario
- The user needs a percentage from multiple counts, potentially including distinct serial numbers.
- Observed behavior
- The Calculated Field option is disabled for the Data Model PivotTable.
Check that the source table is in the Data Model and confirm its table and column names. Decide whether the percentage should count nonblank entries or distinct serial numbers, since repeated serials change the result.
Create a DAX measure for nonblank counts
Use this method to divide the number of nonblank service dates by the number of nonblank serial entries.
Data Model PivotTables use DAX measures instead of traditional calculated fields. COUNTA counts nonblank entries, including text serial numbers; it does not remove duplicates.
Click the PivotTable, then select Power Pivot > Measures > New Measure. If the Power Pivot tab is missing, check whether your Excel edition supports it and whether the add-in is enabled.
Select the source table, enter % Completed as the measure name, and enter =DIVIDE(COUNTA(Table1[Date Serviced]),COUNTA(Table1[Serial #]),0) as the formula. Replace Table1 and the column names with those in your Data Model.
Set the measure format to Percentage in the dialog and click OK. In PivotTable Fields, drag % Completed to the Values area.

Calculate the percentage of distinct serviced serial numbers
Use this method when repeated serial numbers should be counted only once.
Explore PivotTables with WPS Spreadsheet
WPS Office is a free, lightweight Office alternative with a familiar interface and support for Excel files, making it easy to move everyday spreadsheet work to WPS Spreadsheet. Excel Data Model measures remain an Excel-specific solution.

Frequently Asked Questions
Why is Calculated Field grayed out in my PivotTable?
A PivotTable based on the Excel Data Model uses DAX measures rather than traditional calculated fields. Select Power Pivot > Measures > New Measure to create the calculation.
How do I count each serial number only once?
Use DISTINCTCOUNT on the serial-number column in a DAX measure. To exclude blank serials, wrap it in CALCULATE with a nonblank serial filter.
Will the percentage respond to PivotTable filters?
Yes. The measure is evaluated in the current filter context, so PivotTable rows, columns, slicers, and filters can change the counts used in the result.
What happens when there are no serial numbers to count?
The examples use DIVIDE with 0 as its alternate result, so the measure returns 0 when the denominator is zero.
Why is my percentage over 100%?
With independently counted columns, extra nonblank service dates or missing serial entries can make the numerator larger than the denominator. Check the source rows or use the distinct serviced-serial measure if that matches your goal.




