Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
code written by Hans Peter Pfister, www.powerbi-pro.com
let
Source = StockMovements,
Sorting = Table.Sort(Source,{{"Date", Order.Ascending}}),
added_Index = Table.AddIndexColumn(Sorting, "Index", 1, 1),
cumulativ_total = Table.AddColumn(added_Index, "Total", each List.Sum(List.Range(added_Index[Amount],0,[Index]))),
ch_Type = Table.TransformColumnTypes(cumulativ_total,{{"Total", 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
You can’t perform that action at this time.