Forum Discussion

pal95's avatar
pal95
Helper III
4 years ago
Solved

Create a cumulative column from event based table

Hello, I have an event-based table, Accidents, with the following columns: - Date - User - Accident Type - Comment   I would like to create a cumulative line chart from the data above, and...
  • NickolajJessen's avatar
    4 years ago
    Cumulative = 
    Var _res =CALCULATE(
        COUNTROWS(Accidents)
        ,FILTER(ALL('Calendar'), 
            'Calendar'[Date] <= MAX('Calendar'[Date])
            && 'Calendar'[Date] >= (EOMONTH(MIN('Calendar'[Date]), -13)+1)
        )
    )
    
    Var _End =
        CALCULATE(
        COUNTROWS(Accidents)
        ,FILTER(ALL('Calendar'), 'Calendar'[Date] >= MIN('Calendar'[Date]))
    )
    Return
    IF(_End>0,_res)