Combine Data Model Measures and Percentages in an Excel PivotTable
Question details
Combine measures from related Data Model tables and display a safely calculated percentage in an Excel PivotTable.

- Product
- Microsoft Excel
- Device & OS
- not provided
- Scenario
- A PivotTable uses Data Model tables with late and ontime totals that need to be compared by hub or area.
- Observed behavior
- The desired PivotTable shows the measures together and calculates their ratio without division-by-zero errors.
Confirm that the source tables are loaded into the Excel Data Model and that the existing measures are named Total late and Total ontime, or substitute your own measure names. Check that your Excel edition provides the Data Model and Power Pivot features.
Relate the tables and create a DAX percentage measure
Use this method when the totals already exist as measures in the Excel Data Model.
Inspect the hub or area columns in each source table and its related dimension table. Ensure the dimension key is unique and includes every hub or area used by the source tables.
In Excel, select Data > Relationships. Create or edit relationships so each source table's hub or area column links to the matching unique key in the dimension table.
Select Power Pivot > Measures > New Measure. Name the measure perc late A and enter =DIVIDE([Total late],[Total ontime],BLANK()) in the formula box, adjusting the measure names if necessary.
In the measure dialog, select Percentage as the format and choose the desired number of decimal places. Save the measure.
Insert a PivotTable using the workbook's Data Model. In PivotTable Fields, place the hub or area field from the dimension table in Rows, then add Total late, Total ontime, and perc late A to Values.

Work with spreadsheet summaries in WPS Office
WPS Office is a free, lightweight alternative with a familiar interface for working with spreadsheets. Open compatible Excel files and use WPS Spreadsheets for conventional table summaries; Microsoft Excel is still needed for the Data Model and DAX workflow described above.

Frequently Asked Questions
Why does the percentage measure show a blank?
DIVIDE returns BLANK() when Total ontime is zero or blank. Check that measure in the PivotTable and verify the relationships under Data > Relationships.
How do I calculate late items as a percentage of all items instead?
If Total late and Total ontime are mutually exclusive and cover all items, create a measure with =DIVIDE([Total late],[Total late]+[Total ontime],BLANK()). Format it as a percentage in the measure dialog.
Why are some hubs or areas missing from the PivotTable?
Check that each source-table hub or area has a matching key in the dimension table and that the relationships are active under Data > Relationships. Use the dimension table's hub or area field in PivotTable Rows.
Can Power Query prepare the data before I create the PivotTable?
Yes. Use Data > Get Data to import and reshape the tables in Power Query, then use Close & Load To to add the prepared data to the Data Model or load it for a PivotTable.




