Forum Discussion
Anonymous
6 years agoNot applicable
Active userbase calculation
Hi Community Members, Have been wrapping my brain around this one, but can't seem to figure this one out on my one. I have a basic flat table with login behavior. A timestamp of login and which u...
- Anonymous6 years ago
mahoneypat
6 years agoMicrosoft Employee
Please try this expression for the count of users that were active in all of the previous four weeks.
Active Users =
VAR __thisweek =
MIN ( 'Date'[WeekNumber] )
VAR __summary =
FILTER (
CALCULATETABLE (
ADDCOLUMNS (
SUMMARIZE ( Login, 'Date'[WeekNumber], Login[user_id] ),
"@logins", CALCULATE ( COUNTROWS ( Login ) ) + 0
),
ALL ( 'Date'[WeekNumber] ),
'Date'[WeekNumber] < __thisweek
&& 'Date'[WeekNumber] >= __thisweek - 4
),
[@logins] > 0
)
VAR __usersummary =
FILTER (
SUMMARIZE ( __summary, Login[user_id], "@weeks", COUNTROWS ( __summary ) ),
[@weeks] = 4
)
RETURN
COUNTROWS ( __usersummary )
If this works for you, please mark it as the solution. Kudos are appreciated too. Please let me know if not.
Regards,
Pat