Forum Discussion

sonm10's avatar
sonm10
Icon for Helper I rankHelper I
6 years ago
Solved

Cumulative 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...
  • Icey's avatar
    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]
        ) * 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.