Forum Discussion
flaviorangel
3 years agoNew Member
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...
- 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]) ) )
flaviorangel
3 years agoNew Member
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])
)
)TomasAndersson
Solution Sage
3 years agoAh, right. MIN is not needed there.
Glad you managed to get it to work!