Forum Discussion

flaviorangel's avatar
flaviorangel
New Member
3 years ago
Solved

DAX Cumulative sum in date interval

I have a table that registers log access (userIds and dates). I'm counting the number of users in a period of time by doing:   users_distinctcount = DISTINCTCOUNT(userLogTable[userId])   The ent...
  • flaviorangel's avatar
    flaviorangel
    3 years ago

    Thank you! You were right about using ALLSELECTED, but your solution would still not accumulate. Here is the final solution:

    users_distinctcount_acc_until_date =
    CALCULATE(
        [users_distinctcount],
        FILTER(
            ALLSELECTED(userLogTable),
            userLogTable[date] <= max(calendarTable[Date])
        )
    )