Forum Discussion

rhaddad87's avatar
rhaddad87
Icon for Helper I rankHelper I
4 years ago
Solved

Cumulative Running Total based on column or date

Hi, everyone! I'd like to create a cumulative sum column in DAX that calculates the SUM of [FlightHours] from either September to September or everytime [Day/Mo] hits 13 from 17 (The month is split at September 14).   Screenshot below.  Open to any ideas.  Thank you! 

 

  • Anonymous's avatar
    Anonymous
    4 years ago

    HI rhaddad87,

    You can try to use the following calculate column formula if helps:

    formula =
    CALCULATE (
        SUM ( Table[FlightHours] ),
        FILTER (
            'Table',
            [Date] <= EARLIER ( Table[Date] )
                && [Date] >= DATE ( YEAR ( EARLIER ( Table[Date] ) ), 9, 1 ) 
                && [Date] < DATE ( YEAR ( EARLIER ( Table[Date] ) ) + 1, 9, 1 )
        )
    )

    Regards,

    Xiaoxin Sheng

2 Replies

  • Anonymous's avatar
    Anonymous
    Not applicable

    HI rhaddad87,

    You can try to use the following calculate column formula if helps:

    formula =
    CALCULATE (
        SUM ( Table[FlightHours] ),
        FILTER (
            'Table',
            [Date] <= EARLIER ( Table[Date] )
                && [Date] >= DATE ( YEAR ( EARLIER ( Table[Date] ) ), 9, 1 ) 
                && [Date] < DATE ( YEAR ( EARLIER ( Table[Date] ) ) + 1, 9, 1 )
        )
    )

    Regards,

    Xiaoxin Sheng