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.
Icey
Community Support
6 years agoHi 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]
) * 100
But 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.