Instantly share code, notes, and snippets.

Embed
What would you like to do?
// Code written by Hans Peter Pfister, www.powerbi-pro.com
let
Quelle = Lagerbewegungen,
Sorting = Table.Sort(Quelle,{{"Datum", Order.Ascending}}),
added_Index = Table.AddIndexColumn(Sorting, "Index", 1, 1),
cumulativ_total = Table.AddColumn(
added_Index, "Saldo",
each List.Sum(
List.Range(added_Index[Betrag],0,[Index])
)
),
ch_Type = Table.TransformColumnTypes(cumulativ_total,{{"Saldo", Int64.Type}}),
removed_column = Table.RemoveColumns(ch_Type,{"Index"})
in
removed_column
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment