Hi, I am new to Power Query and have an issue with a task which is relatively easy to complete in excel.
I need to get a loop calculation where the next output is dependant on the previous output in two places. Please see below for a brief snapshot.
The Starting point is 100 and no calculation is required. Column B is fixed throughout. Column C values vary between 0 - 15.
The operations is (Previous Answer * Column B) + Previous Answer + Column C
Column A Column B Column C Column D (Operation)
Jan -0.0023 0 (100 * -0.0023) + 100 +0 = 99.77
Feb -0.0023 0 (99.77 * -0.0023) + 99.7 +0 =99.54
Mar -0.0023 7 (99.54 * -0.0023) + 99.54 + 7 = 106.31
Apr -0.0023 0 (106.31 * -0.0023) + 106.31 + 0 =106.07
I came across the following but I am unable to manipulate the code to carry out the multiplication in the first step.
let _b = #"Added Index"{0} in
List.Accumulate(
List.Combine(
{{_b},
List.Range(#"Added Index"[A], 0, [Index] + 1)}),
0, (s, c) => s + c)
Any help would be greatly appreciated!
I need to get a loop calculation where the next output is dependant on the previous output in two places. Please see below for a brief snapshot.
The Starting point is 100 and no calculation is required. Column B is fixed throughout. Column C values vary between 0 - 15.
The operations is (Previous Answer * Column B) + Previous Answer + Column C
Column A Column B Column C Column D (Operation)
Jan -0.0023 0 (100 * -0.0023) + 100 +0 = 99.77
Feb -0.0023 0 (99.77 * -0.0023) + 99.7 +0 =99.54
Mar -0.0023 7 (99.54 * -0.0023) + 99.54 + 7 = 106.31
Apr -0.0023 0 (106.31 * -0.0023) + 106.31 + 0 =106.07
I came across the following but I am unable to manipulate the code to carry out the multiplication in the first step.
let _b = #"Added Index"{0} in
List.Accumulate(
List.Combine(
{{_b},
List.Range(#"Added Index"[A], 0, [Index] + 1)}),
0, (s, c) => s + c)
Any help would be greatly appreciated!