Last active
June 4, 2018 14:37
-
-
Save HansPeterPfister/4e66f813dbea27ae9da48d16b7193be3 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Code written by Hans Peter Pfister, www.powerbi-pro.com | |
(Input as table) => | |
let | |
Sorting = Table.Sort(Input,{{"Datum", Order.Ascending}}), // Sort table | |
added_Index = Table.AddIndexColumn(Sorting, "Index", 1, 1), // add Index, base 1 | |
cumulativ_total = Table.AddColumn( // add new column with running total | |
added_Index, "Saldo", | |
each List.Sum( | |
List.Range(added_Index[Betrag],0,[Index]) | |
) | |
), | |
extract_total = cumulativ_total[Saldo] // transform new column into list as result for grouping | |
in | |
extract_total |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment