Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.
I have tables
DIM_USER (user_key, user_id, register_date)
DIM_DATE (date_key, date)
FACT_USER_ACTIVITY (user_key, activity_id, date_key)
Now I want to calculate the second day retention rate, literally it means
the quantity of users registered on previous day who login in the app today / quantity of users registered on previous day
I'm expecting a measure.
date | second_day_retention_rate |
2019-6-7 | |
2019-6-6 | |
2019-6-5 | |
2019-6-4 | |
2019-6-3 | |
2019-6-2 | |
2019-6-1 | |
2019-5-31 |
I'm struggling on this issue for hours, could anyone give me some tips? Thanks in advance!
Solved! Go to Solution.
Hi @booooosevic ,
In this scenario, we need to create another data table provided for calculating the retention rate, this table has no relationship with these three tables.
Then we can create a measure like below:
second day retention rate = VAR users_registered_on_previous_day = CALCULATE ( COUNTROWS ( DIM_USER ), FILTER ( ALL ( DIM_USER ), DIM_USER[register_date] = MIN ( 'Date'[Date] ) - 1 ) ) VAR users_registered_on_previous_day_who_login_in_the_app_today = CALCULATE ( DISTINCTCOUNT ( FACT_USER_ACTIVITY[user_key] ), FILTER ( ALL ( DIM_DATE ), DIM_DATE[date] = MIN ( 'Date'[Date] ) ) ) RETURN DIVIDE ( users_registered_on_previous_day_who_login_in_the_app_today, users_registered_on_previous_day, 0 )
The result will lkie below:
Best Regards,
Teige
Hi @booooosevic ,
In this scenario, we need to create another data table provided for calculating the retention rate, this table has no relationship with these three tables.
Then we can create a measure like below:
second day retention rate = VAR users_registered_on_previous_day = CALCULATE ( COUNTROWS ( DIM_USER ), FILTER ( ALL ( DIM_USER ), DIM_USER[register_date] = MIN ( 'Date'[Date] ) - 1 ) ) VAR users_registered_on_previous_day_who_login_in_the_app_today = CALCULATE ( DISTINCTCOUNT ( FACT_USER_ACTIVITY[user_key] ), FILTER ( ALL ( DIM_DATE ), DIM_DATE[date] = MIN ( 'Date'[Date] ) ) ) RETURN DIVIDE ( users_registered_on_previous_day_who_login_in_the_app_today, users_registered_on_previous_day, 0 )
The result will lkie below:
Best Regards,
Teige
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
117 | |
104 | |
77 | |
73 | |
52 |
User | Count |
---|---|
145 | |
109 | |
109 | |
90 | |
64 |