19.2Running totals and moving averages

For a running total in classic DAX, you combined CALCULATE, FILTER, ALL and MAX, or used WINDOW. In a visual calculation, a single function is enough.

19.2.1RUNNINGSUM

In Excel
ExcelSUM($G$2:G2), copied down
Match

You need it when the running total must be read in the visual itself, year after year.

Watch out!

RUNNINGSUM can be written only in a visual calculation. Power BI rejects it in a measure, a calculated column or a calculated table. On izyDAX, the names of the functions reserved for visual calculations are written in orange.

RUNNINGSUM adds up the value of the row and those of the previous rows, in ascending order of the axis values.

RUNNINGSUM( <field> )

It expects a field of the visual, written in square brackets, such as [Revenue]. Here, the axis of the visual holds the years.

Running Total = RUNNINGSUM( [Revenue] )
Table visual, The “Running Total” visual calculation by year
YearRunning Total
2024750,000
20251,700,000
Total1,700,000

This is a reproduction of the Power BI interface for teaching purposes. It differs from the real interface.

It is the result of the “Running Total Revenue” measure, without any filter to write.

Practice

Each exercise is solved with the function you just discovered. Two exercises per function, a direct use and a combined use, from easiest to hardest, on data other than the course data. Pick the right formula out of five.

  1. Direct useVisual calculationDifficulty

    A weather station has a Table visual by month with its “Rain” measure, which adds up the rain that fell, in millimeters. The month column is sorted in calendar order. Write the “Cumulative Rain” visual calculation on this visual.

    The visual
    MonthRain
    January80
    February60
    March45

    Which formula should you write for “Cumulative Rain”?

  2. Combined useVisual calculationDifficulty

    A carrier aims to deliver 200 parcels over the quarter. It has a Table visual by month with its “Parcels” measure, which adds up the parcels. The month column is sorted in calendar order. Write the “Left to Deliver” visual calculation on this visual, the number of parcels still missing to reach 200 at the end of each month.

    The visual
    MonthParcels
    January80
    February60
    March45

The rest of this lesson is part of izyDAX Pro

You have just read the first section. The next one, its animations, the exercises and the summary are waiting for you with izyDAX Pro, in a single payment.