How to Replace Power Query Calculations with DAX in Excel
Question details
The user wants to transition from using Power Query for data unpivoting, delta calculations, and repivoting to using DAX measures and relationships for a more optimized Data Model.

- Product
- Microsoft Excel
- Device & OS
- not provided
- Scenario
- Optimizing an Excel data model to produce dynamic PivotTable views using relational tables and DAX instead of fixed query transformations.
- Observed behavior
- Currently relying on Power Query to reshape data and calculate deltas, the goal is to load structured fact and dimension tables and handle the calculations dynamically via DAX.
Ensure your source data is organized logically into fact and dimension tables, and verify that the Power Pivot add-in is enabled in your Excel application.
Build a Relational Data Model and Create DAX Measures
Load raw tables directly into the Data Model and use explicit DAX measures to calculate scenarios and deltas on the fly, eliminating the need for complex Power Query transformations.
By using DAX (Data Analysis Expressions), you can calculate deltas and scenario values dynamically within the PivotTable context. This simplifies the Power Query refresh process and provides a highly flexible reporting structure.
Go to the 'Power Pivot' tab, select your raw data table, and click 'Add to Data Model'. Repeat this step for both your fact table and dimension (scenario) tables.
Open the Power Pivot window, click on 'Diagram View', and drag the related fields (e.g., Scenario ID) to establish connections between your dimension tables and your fact table.
In the Power Pivot window, click the calculation area below your fact table. Use the CALCULATE function to define explicit measures, for example: Actuals := CALCULATE(SUM(Table[Value]), Table[Scenario]="Actual").
Create an additional measure to calculate the variance based on the previously created measures, such as: Delta := [Actuals] - [Budget].
Return to the Excel window, click 'Insert' > 'PivotTable' > 'From Data Model'. Place your dimension attributes in rows or columns and your newly created DAX measures into the Values area.

Calculate Deltas Directly in Source Columns
If a full Data Model is unnecessary for your reporting needs, you can calculate the deltas using standard column formulas before generating the PivotTable.
Try WPS Office for Efficient Data Analysis
While advanced DAX calculations and Power Pivot data modeling are specific to Microsoft Excel, WPS Office offers a powerful, lightweight, and free alternative for comprehensive data management. You can easily build standard PivotTables, utilize calculated fields for deltas, and visualize your data without heavy processing overhead.
- 1. Open your data in WPS: Launch WPS Spreadsheets and open your .xlsx file containing the raw dataset.
- 2. Insert a PivotTable: Navigate to the Insert tab and click PivotTable to begin summarizing your scenarios.
- 3. Add Calculated Fields: Use the built-in Calculated Field option in the PivotTable settings to compute deltas directly without complex DAX.

Frequently Asked Questions
Why should I use DAX instead of Power Query for delta calculations?
Power Query is best used for shaping and cleaning data before it loads. DAX calculations operate dynamically within the Data Model, allowing PivotTables to compute deltas instantly based on user-selected filters and slicers without needing to refresh the query every time.
Can I use slicers with DAX measures?
Yes. When you build a PivotTable from the Data Model, slicers connected to your dimension tables will automatically filter the DAX measures, providing highly interactive and dynamic reporting.
What is the difference between a fact table and a dimension table?
A fact table contains the quantitative transactional data (like sales amounts or budgets) and foreign keys. A dimension table contains descriptive attributes (like scenario names, specific dates, or product categories) that are used to filter and group the data in the fact table.
Do I need a Microsoft 365 subscription to use DAX in Excel?
DAX and the Power Pivot add-in are available in many standalone versions of Excel (such as Office 2016, 2019, and 2021 Professional Plus) as well as Microsoft 365, though exact feature availability may vary depending on your specific license.




