Excel PivotTable Calculated Field Alternatives for Two-Table Models
Question details
Find an alternative to a traditional calculated field for a PivotTable that uses two related tables.

- Product
- Microsoft Excel PivotTable and Data Model
- Device & OS
- not provided
- Scenario
- The user wants to calculate and summarize values in a PivotTable built from two related tables.
- Observed behavior
- Traditional PivotTable calculated fields do not behave as expected with the two-table model.
Check that both tables are in the Excel Data Model and identify the columns that link them. The lookup-side key should contain unique values, and the related key columns should have compatible data types.
Create a DAX measure in the Data Model
Use a measure when the calculation needs to respond to PivotTable filters or use relationships between tables.
A measure calculates a result in the current filter context. The example below multiplies quantity by unit price for each Sales row and sums the results; replace the table and column names with your own.
Open Data > Relationships, select New, and connect the matching key columns in the two tables. If the relationship already exists, verify it in the same dialog.
Open Power Pivot > Measures > New Measure. Select the Sales table, name the measure Total Sales, and enter =SUMX(Sales, Sales[Quantity] * Sales[Unit Price]) in the formula box.
In the PivotTable Fields pane, drag Total Sales to Values. Add fields from the related tables to Rows, Columns, or Filters and check the results.

Add a calculation column to the source table
Use a source column for a row-level calculation that does not require values from the related table.
Explore spreadsheet summaries with WPS Office
WPS Office is a free, lightweight alternative with a familiar spreadsheet interface and Microsoft Office format support for easier migration. Use it for everyday spreadsheet summaries; it is not a fix for Excel Data Model or DAX measure behavior.

Frequently Asked Questions
Why use a measure instead of a calculated field?
A DAX measure is designed for the Data Model and can respond to the PivotTable's filter context and relationships. Create one through Power Pivot > Measures > New Measure.
How do I connect the two tables?
In Excel, open Data > Relationships and select New. Choose the matching key columns, making sure the lookup-side key has unique values and the key columns have compatible data types.
Can a measure use a price stored in a different table?
Yes. With an appropriate relationship, use RELATED inside a row iterator such as SUMX to retrieve the price from the lookup table for each sales row.
When is a source-table column enough?
A source column is suitable when each row can be calculated from values in that same table. Add the formula to the source table, refresh the PivotTable, and summarize the new column in Values.




