Reputation: 27
I have the following table on Power Query:
I want to update the outgoings and remnant based on the previous row, like the following example:
Is this possible?
Upvotes: 0
Views: 188
Reputation: 128
This is one way of doing it, add an index and one-line cumulative function
let
cum_add = (x) => List.Sum(Table.SelectRows(#"Added Index", each [Index] <= x) [Remnant]),
Source = Excel.CurrentWorkbook(){[Name="Table1"]}[Content],
#"Added Index" = Table.AddIndexColumn(Source, "Index", 0, 1),
#"Added Cumulative" = Table.AddColumn(#"Added Index", "Custom", each cum_add([Index] ))
in
#"Added Cumulative"
You'll need to go into the Advanced Editor to do this
Upvotes: 1