Forum Discussion
sonm10
Helper I
6 years agoCumulative calcualtion on the same column
Hello All, I have a table with various item and their value for dates. I have calculated the change of their value as return. Now I need to create a column that refers to its previous value of th...
- 6 years ago
Hi sonm10 ,
Please check if this is what you want:
Column 2 = VAR CurrentDate = [Date] VAR t = ADDCOLUMNS ( 'Table', "Return_1", [Return] + 1 ) RETURN PRODUCTX ( FILTER ( t, [Type] = EARLIER ( [Type] ) && [Date] <= CurrentDate ), [Return_1] ) * 100But I have some confusion. Is the data marked above written wrong?
Best Regards,
Icey
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
amitchandak
Super User
6 years agosonm10 , try a new column
if(coalesce([Return],0) =0,100 , [value] * (1+ [return]))
if(([Return]+0) =0,100 , [value] * (1+ [return]))