Hi,
I am trying to create a calculated column that calculates cumulative sum from previous values in the same column. On a spreadsheet I can do it pretty easily as below:
value_date portfolio_number first_value diff_to_target nominal_new
1.11.2015 4 TRUE 10 10
2.11.2015 4 FALSE 15 5
3.11.2015 4 FALSE 20 5
4.11.2015 4 FALSE 25 5
5.11.2015 4 FALSE 30 5
6.11.2015 4 FALSE 35 5
7.11.2015 4 FALSE 40 5
8.11.2015 4 FALSE 45 5
9.11.2015 4 FALSE 50 5
and the formula on spreadsheet is:
However, PowerPivot doesn't accept that formula because of circular dependency. I was thinking this should be an easy one to build but cant' figure it out. Thanks for any help!
br,
Jack
I am trying to create a calculated column that calculates cumulative sum from previous values in the same column. On a spreadsheet I can do it pretty easily as below:
value_date portfolio_number first_value diff_to_target nominal_new
1.11.2015 4 TRUE 10 10
2.11.2015 4 FALSE 15 5
3.11.2015 4 FALSE 20 5
4.11.2015 4 FALSE 25 5
5.11.2015 4 FALSE 30 5
6.11.2015 4 FALSE 35 5
7.11.2015 4 FALSE 40 5
8.11.2015 4 FALSE 45 5
9.11.2015 4 FALSE 50 5
and the formula on spreadsheet is:
Code:
=IF(C4=TRUE;D4;D4-SUMIF($B$2:B3;B4;$E$2:E3))CODE]
So, I would like get nominal_new as calculated column in PowerPivot. For that I need to look diff_to_target at current row and then deduct sum of nominal_new from previous rows in nominal_new column. So, for example for value_date 3.11.2015 nominal new would be 20 (diff_to_target) - 15 (nominal_new 1.11.2015=10+nominal_new 2.11.2015=5) = 5.
For that I tried to create a formula: [CODE]=[diff_to_target]-CALCULATE(SUM(data[nominal_new]);FILTER(ALLEXCEPT(data;data[portfolio_number]);data[value_date]<EARLIER(data[value_date])))
However, PowerPivot doesn't accept that formula because of circular dependency. I was thinking this should be an easy one to build but cant' figure it out. Thanks for any help!
br,
Jack