Power Query Problems

Excel Power Query: Filter a SUM Calculation with DAX

Huma Ashraf ChHuma Ashraf Ch Nov 12, 2026 868 views

Question details

The user needs to filter numeric values in the Nr. column while calculating a total from the Amount column.

Product
Microsoft Excel Power Query and Power Pivot DAX
Device & OS
not provided
Scenario
The user is working with tabular data and wants the SUM result to include only rows that meet a numeric condition, such as Nr. greater than 0 or equal to 5.
Observed behavior
CALCULATE is being considered for a Power Query formula, although CALCULATE is a DAX function used in the Data Model or Power Pivot rather than standard Power Query.
Before you start

Confirm whether the calculation belongs in the Power Pivot Data Model or in the Power Query Editor. Check the exact table name and the numeric column names, such as Amount and Nr., before creating the measure or filter.

Solution 1Recommended

Create a filtered SUM measure in Power Pivot with DAX

Use this method when the data is loaded into the Excel Data Model or managed through Power Pivot.

CALCULATE changes the filter context of a DAX expression. Add the condition as a CALCULATE argument, and replace the example table and column names with those in your model.

1
Open Power Pivot

In Excel, select the Power Pivot tab and choose Manage to open the Data Model window.

2
Create a measure

Select the table containing Amount, choose Home > Calculations > New Measure, and enter a formula such as =CALCULATE(SUM(Data[Amount]),Data[Nr]>0).

3
Apply an exact-value filter

For a specific number instead, use a condition such as =CALCULATE(SUM(Data[Amount]),Data[Nr]=5), then replace Data[Amount] and Data[Nr] with the actual table and column names.

4
Use the measure in a report

Click OK, then insert the measure into a PivotTable or other Data Model report to display the filtered total.

Choose the correct calculation engine: CALCULATE works in DAX measures for Power Pivot or the Data Model. It is not a standard Power Query M function.
Free Microsoft Office alternative

Use WPS Office as a lightweight alternative for filtered spreadsheet totals

WPS Office is a free, lightweight Microsoft Office alternative for opening, editing, and analyzing compatible spreadsheet files. While it does not replace Excel Power Query or Power Pivot DAX, you can migrate the prepared data to WPS Spreadsheets, filter rows, and calculate totals using a familiar interface with seamless XLSX support.

  1. 1. Open the workbook: Launch WPS Spreadsheet and select Open to import the Excel XLSX file.
  2. 2. Filter the source data: Select the data range, choose Data > AutoFilter, and apply a condition to the Nr. column.
  3. 3. Calculate the filtered total: Use a formula such as SUBTOTAL on the filtered Amount column, or create a PivotTable from the filtered data.
Open and edit Microsoft Excel XLSX workbooks with familiar spreadsheet tools.Filter the Nr. column and calculate totals from Amount using spreadsheet formulas.Use a lightweight interface for reviewing and cleaning tabular data without a full Power Query setup.Maintain compatibility with Microsoft Excel XLSX and XLS formats during migration.
microsoft office alternative - wps office

Frequently Asked Questions

Can I use CALCULATE directly in Power Query?

No. CALCULATE is a DAX function for Power Pivot and the Excel Data Model. In Power Query, use the column filter menu or an M function such as Table.SelectRows.

How do I sum Amount only when Nr. is greater than zero?

In a Power Pivot measure, use =CALCULATE(SUM(Data[Amount]),Data[Nr]>0). Replace Data, Amount, and Nr. with the actual names in your model.

How can I filter for one exact Nr. value?

Use an equality condition in DAX, such as =CALCULATE(SUM(Data[Amount]),Data[Nr]=5). In Power Query, open the Nr. filter menu and select Number Filters > Equals.

What is the Power Query equivalent of filtering rows before a sum?

Use Table.SelectRows with a row condition, for example Table.SelectRows(Source, each [Nr] > 0), and then load or aggregate the filtered result.