Running totals in Power Query, using the List.Range function
The List.Range M language function can create running totals - when each row is a summary of it an all rows above.
Lets use this table (it must have the Index column):
Table_with_index[Price], - na name of previous step and column used for summarizing
0, - the start is from first item (Power Query calculate from 0, not from 1...)
[Index]) - we will get as many numbers from Price, as defined in Index column
Then simply switch the datatype of result column to number:
and group it, using Sum:
Nice, but isn't it too long?
If you are not afraid of M language, you can use List.Accumulate and do it all in one formula.
(state, current)=>state + current)
Similarly, you can use List.Sum: