Last active
June 4, 2018 14:45
-
-
Save HansPeterPfister/6ee4ed765df5cb071178fde99c4324af 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 | |
let | |
Source = Lagerbewegungen, | |
Calc_Running_Total = Table.Group( | |
Source, // table as table | |
{"Produkt"}, // key as any | |
// aggregatedColumns as list | |
{{"Daten", // name of new column to be created | |
// Function Call | |
(Input as table) as table => // data for function | |
let | |
Call_Function = fn_cumulative_Total(Input), | |
// End of Function Call | |
result = Table.FromColumns( // tidy up | |
Table.ToColumns(Input)&{Call_Function}, | |
Value.Type( | |
Table.AddColumn( | |
Input, "Saldo", each null, type number | |
) | |
) | |
) | |
in | |
result, | |
type table}} // transform into table | |
), | |
Expanded_Data = Table.ExpandTableColumn(Calc_Running_Total, "Daten", {"Datum", "Betrag", "Saldo"}, {"Datum", "Betrag", "Saldo"}) | |
in | |
Expanded_Data |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment