Forum Discussion

Syndicate_Admin's avatar
Syndicate_Admin
Administrator
4 years ago

cumulative count

Good, hoping you are well.

I would like to know how I can generate a cumulative measure, I have two tables, one of users with the date on which they registered and another of the calendar, I would like to know how I can count and accumulate to see the increase of users per day based on the calendar table, example:

Users table:

UserRegisterLoud
Usuario1101/01/2021
usuario2101/05/2021
usuario31 01/03/2021

Calendar table:

DateMonthweekDay
01/01/2021111
02/01/2021112
03/01/2021113
04/01/2021114
05/01/2021115
06/01/2021116
07/01/2021117
08/01/2021121
09/01/2021122

Matrix to be generated:

01/01/202102/01/202103/01/202104/01/202105/01/202106/01/202107/01/2021
1122333

I tried the following but it goes wrong:

Count =
was totalA=
CALCULATE(SUM(agent[Register]),
FILTER(
ALLSELECTED(Calendar[Date]),ISONORAFTER(Calendar[Date],MAX(Calendar[Date]),DESC)))
return IF(ISBLANK(totalA),0,totalA)

Thank you in advance.

Best regards

1 Reply

  • Syndicate_Admin , measure seem fine. Make sure calendar is connected  agent on the date.

     

    Try one of the two

     

    CALCULATE(SUM(agent[Register]),
    FILTER(
    ALLSELECTED(Calendar[Date]),Calendar[Date]< = MAX(Calendar[Date])))

     

    or

     

     

    CALCULATE(SUM(agent[Register]),
    FILTER(
    ALL(Calendar[Date]),Calendar[Date]< = MAX(Calendar[Date])))