Forum Discussion
Power Query - Loop calculating
- 6 years ago
Hi Anonymous ,
First, create a index column and this code for a custom column:
let _b = #"Added Index"[B]{0} in
List.Accumulate(
List.Combine(
{{_b},
List.Range(#"Added Index"[A], 0, [Index] + 1)}),
0, (s, c) => s + c)Change the bold part with your last step name.
Hi Anonymous ,
First, create a index column and this code for a custom column:
let _b = #"Added Index"[B]{0} in
List.Accumulate(
List.Combine(
{{_b},
List.Range(#"Added Index"[A], 0, [Index] + 1)}),
0, (s, c) => s + c)
Change the bold part with your last step name.
Hi camargos88 ,
Yes! This is exactly what I was trying to figure out. I didn't consider using list.combine, it was what was missing for reasoning.
Anyway, I didn't understand what {_b} means, could you please explain?
And really thanks for the help!
My best regards!!
- camargos886 years ago
Community Champion
Hi Anonymous ,
I'm glad it helped.
The function List.Combine has a parameter (list of lists). So you need to convert _b to a list.. that's why {_b}.
- Anonymous6 years agoNot applicable