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 | |
let | |
Source = (Input as table) => | |
let | |
Sorting = Table.Sort(Input,{{"Date", 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, "Total", | |
each List.Sum( | |
List.Range(added_Index[Amount],0,[Index]) | |
) | |
), | |
extract_total = cumulativ_total[Total] // transform new column into list as result for grouping | |
in | |
extract_total | |
in | |
Source |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment