Forum Discussion
Anonymous
2 years agoNot applicable
for loops to generate a dataframe
Hi Guys, given this code: NewTable = ADDCOLUMNS ( SUMMARIZE ( table, table[Date] ), "AP_0", [AP_0] ) I need to make it dynamic in the following sense. I created a measure called AP w...
ppm1
2 years agoSolution Sage
Are you sure this needs to be recursive? You could start with a virtual table in a variable with your index values (j, k, ...) and use ADDCOLUMNS with your measure to determine it in that row context.
If it truly needs to be recursive, it is not practical in DAX for a high number of cycles, but you can do it in Power Query with List.Generate or List.Accumulate (or a custom function).
Pat