Forum Discussion
littlemojopuppy
6 years agoCommunity Champion
Customer Retention Calculation Over Successive Weeks
Hi! Looking for a little advice. Requirement is to calculate the number of customers who logged in on a given date, and then who logged in again in each of of the six one week time periods from tha...
v-lionel-msft
6 years agoCommunity Support
Hi littlemojopuppy ,
Maybe you can add an [Index] and simplify the code.
Users Returning Within 42 Days =
VAR Weeks = 5
RETURN
COUNTROWS (
CALCULATETABLE (
VALUES ( IdentityLog[IdentityId] ),
CALCULATETABLE (
VALUES ( IdentityLog[IdentityId] ),
DATESINPERIOD (
'Calendar'[Date],
DATEADD (
LASTDATE ( 'Calendar'[Date] ),
( (Weeks- MAX([Index] )* 7 ) + 1,
DAY
),
7,
DAY
)
)
)
)
Best regards,
Lionel Chen
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
littlemojopuppy
6 years agoCommunity Champion
I'll try it out...thank you! 🙂