Forum Discussion

vsslasd1's avatar
vsslasd1
Helper III
3 years ago
Solved

Running Sum Question

I am trying to create a running sum formula for a graph.  The X-Axis should have the Date The Y-Axis should have the Running Sum Amount   The Legend should be the transaction type, and thos...
  • v-zhangti's avatar
    v-zhangti
    3 years ago

    Hi, vsslasd1 

     

    You can try the following methods.
    Column:

    Column = 
    CALCULATE (
        SUM ( 'Table'[Amount] ),
        FILTER (
            'Table',
            [OverrideDate] <= EARLIER ( 'Table'[OverrideDate] )
                && [Transaction_Type] = EARLIER ( 'Table'[Transaction_Type] )
        )
    )

    Measure:

    Running sum = 
    CALCULATE (
        SUM ( 'Table'[Amount] ),
        FILTER (
            ALL ( 'Table' ),
            [OverrideDate] <= SELECTEDVALUE ( 'Table'[OverrideDate] )
                && [Transaction_Type] = SELECTEDVALUE ( 'Table'[Transaction_Type] )
        )
    )

    Result:

    Is this the result you expect?

    Best Regards,

    Community Support Team _Charlotte

    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.