Power Pivot Running Total

Mynda Treacy

July 15, 2021

In this tutorial we’ll look at how to create a Power Pivot running total that allows you to see the aggregation at the month, quarter and year levels enabling you to create charts like this:

Power Pivot running total chart

Note: parts of this tutorial require Power Pivot in Excel or Power BI. Check if your version of Excel has Power Pivot.

Watch the Video

Subscribe YouTube

Download Workbook

Enter your email address below to download the sample workbook.

By submitting your email address you agree that we can email you our Excel newsletter.

PivotTable Running Totals using Show Values As

In both regular and Power Pivot PivotTables we can use the Show Values As tools to create running totals through the right-click menu as shown below:

PivotTable Show Values As running total

However, when your data is grouped by dates as mine is, these running totals can only be displayed at one level: either Year, Quarter or Month. For example, if I choose the Year level you can see the data at the quarters level is not a running total from one quarter to the next which makes for a confusing PivotTable:

wrong running total

Instead, what we typically want is this where the quarters increment in line with the calendar year:

correct running total

PivotTable Running Totals using DAX Measure

In Power Pivot PivotTables and Power BI we can use the DAX formula language to write a measure that calculates the running total as you’d expect.

For this your data needs to be loaded to the Power Pivot Data Model, which you can select when creating the PivotTable:

add data to the data model

In my data model I have 3 tables, one for Actual Costs, Budgeted Costs and Forecast Costs and a calendar table to relate the tables together enabling me to create a single PivotTable and chart that contains data from all 3 tables:

create power pivot relationships

Now you can set up the measure via the Power Pivot tab on the ribbon > Measures > New Measure:

create power pivot measure

I’ll create the measure for the Actual Running Total first, which I’ll call Actual RT. In the Measure dialog box assign the measure to the Actual table (1), enter the name (2), formula (3), and formatting (4):

Power Pivot running total formula

Build the PivotTable being sure to use the date fields from the Calendar table and the new measure you’ve just written:

Power Pivot running total formula result

Please watch the video for step by step instructions.

AUTHOR Mynda Treacy Co-Founder / Owner at My Online Training Hub

CIMA qualified Accountant with over 25 years experience in roles such as Global IT Financial Controller for investment banking firms Barclays Capital and NatWest Markets.

Mynda has been awarded Microsoft MVP status every year since 2014 for her expertise and contributions to educating people about Microsoft Excel.

Mynda teaches several courses here at MOTH including Excel Expert, Excel Dashboards, Power BI, Power Query and Power Pivot.

7 thoughts on “Power Pivot Running Total”

  1. Hi,

    First – thank you for this. Great example.

    I think I may have found a flaw, however:

    Given there are 2 datasets:

    Dataset A
    ————–
    Outgoings for Apr-22 to Mar-23
    Contains two columns: [Month] and [Outgoings]

    Dataset B
    ————–
    Income for Apr-22 to Mar-23
    Contains two columns: [Month] and [Income]

    Given there are NO recorded Outgoings for Sep-22
    Given there ARE recorded Outgoings for all months other than Sep-22 (i.e. Apr-22 to Mar-23)
    Given there ARE recorded Income all year round (i.e. Apr-22 to Mar-23)
    Given a [Month] lookup has been created for each of the months Apr-22 to Mar-23

    Then: when populating a Power Pivot table, Sep-22 is blank/empty for Outgoings

    The rolling-sum works perfectly up to Aug-22 for Outgoings, then shows a blank!

    It then “picks up” again with correct calculations on the following month (Oct-22) BUT, if you attempt to perform a calculation (i.e. [Income] – [Outgoings]) you get incorrect results because the [Income] field has a value in it, but the [Outgoings] field is blank for that month (rather than a ‘repeat’ of the previous month’s amount)

    One solution (which I’d rather not implement) is to add a row into the raw/source data for Outgoings for Sep-22 with a value of zero. At least I think that would work – haven’t tried it yet.

    However, without that, how would you navigate around this issue using just the DAX?

    Looking at other comments, it seems to be the policy to forward on to your forum, so (time permitting) will do that shortly!

    Many thanks!

    Reply
  2. Hi – I have a worksheet with many data fields based on various incomes split in to to rows which represent each month of the year, I have created measures to show what percentage one column field is of another, however, when i change these column fields to running totals the % measure I have created stays the same, how do I create a % measure based on running total values

    Reply
  3. Great explanation of running total, it worked flawlessly. If I wanted to add a second or third criteria to the filter, e.g. only sum values for Actual RT with table[other_column] = “x”, how would I do that?

    Reply
    • Hard to say without seeing your file. Please post your question on our Excel forum where you can also upload a sample file containing your data model and illustrating your desired result, and we can help you further.

      Reply

Leave a Comment

Current ye@r *