Calculation Issues

How to Create a DAX Running Total by Product and Store in Power Pivot

Phi Hung VoPhi Hung Vo Nov 13, 2026 869 views

Question details

User needs a DAX measure that calculates a running total for the current year-week while preserving Product and Store filters in a Power Pivot or Power BI report.

How to Create a DAX Running Total by Product and Store
Product
Microsoft Power Pivot / Power BI (DAX measures)
Device & OS
not provided
Scenario
Building a Power Pivot or Power BI report that requires a cumulative sales total for each product and store over time.
Observed behavior
The running total should accumulate sales from all earlier year-weeks and continue to respect the selected Product and Store filters.
Before you start

Confirm that your data model contains a Sales table with SLS, Product, Store, and YEARWEEK columns, and that the Power Pivot or Power BI measure editor is available.

Solution 1Recommended

Use an ALLEXCEPT Measure to Keep Product and Store Filters

Use this method when the running total should preserve the current Product and Store selections and accumulate sales by YEARWEEK.

The ALLEXCEPT function removes filters from the Sales table except for Product and Store, so the FILTER condition can compare every YEARWEEK value against the latest YEARWEEK without dropping the product and store context.

1
Open the measure editor

In Power BI, select the Sales table in the Data pane and choose New measure. In Power Pivot, open the calculation area below the data and click a blank cell.

2
Create the running total formula

Enter: slsRT := CALCULATE(SUM('Sales'[SLS]), FILTER(ALLEXCEPT('Sales','Sales'[Product],'Sales'[Store]), 'Sales'[YEARWEEK] <= MAX('Sales'[YEARWEEK])))

3
Apply and test the measure

Add Product and Store fields to the report as slicers or rows, then place the measure in a table or chart to verify the cumulative total.

Use an ALLEXCEPT Measure to Keep Product and Store Filters
Measure ready: The running total now accumulates all earlier year-weeks without dropping the selected product and store.
Free Microsoft Office alternative

Use WPS Office as a Free Spreadsheet Alternative for Running Totals and Reports

If DAX in Power Pivot or Power BI feels complex, WPS Office offers a free, lightweight spreadsheet with Excel-compatible formulas, pivot tables, and a familiar interface. You can open your workbooks, create running totals with formulas or pivot tables, and save back to .xlsx without losing data.

  1. 1. Download and install WPS Office: Get WPS Office from the official WPS site and install the free version on your device.
  2. 2. Open the Excel workbook in WPS Spreadsheets: Launch WPS Spreadsheets, select Open, and choose the .xlsx report that contains your sales data.
  3. 3. Recreate the running total with formulas or a pivot table: Use helper columns or pivot tables to maintain Product and Store filters, or apply SUMIFS and cumulative formulas for year-week totals.
Build product-and-store running totals with WPS Spreadsheets formulas or pivot tables instead of writing DAX.Open and save .xlsx workbooks with full Microsoft Excel format compatibility.Familiar ribbon interface and lightweight performance for quick report editing.Free to download and use for everyday spreadsheet, document, and presentation tasks.
microsoft office alternative - wps office

Frequently Asked Questions

Why does my DAX running total ignore the Product or Store filter?

Usually the ALL or ALLEXCEPT arguments are removing the wrong columns. For a product-and-store running total, keep both Product and Store inside ALLEXCEPT, or compare Store and Product to SELECTEDVALUE in the FILTER expression.

Can I use this measure in both Excel Power Pivot and Power BI?

Yes. The formula works in both as long as the table and column names in your data model match exactly; replace Sales, SLS, Product, Store, and YEARWEEK with your actual names.

What should I do if my date column is a calendar date instead of YEARWEEK?

Replace YEARWEEK with a date column from a proper calendar table, then use MAX('Calendar'[Date]) and set a relationship to the Sales table so the running total follows chronological order.

Does WPS Office support Power Pivot or DAX measures?

WPS Office does not include the Power Pivot DAX data model. You can open .xlsx files in WPS Spreadsheets and build running totals with formulas or pivot tables, but DAX measures require Excel Power Pivot or Power BI.