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.
Hi all, I'm very new to Power bi. I have a task to create a cohort report. This report will display the number of users who registered in a specific week (this is easy, I could do that), but then I need to count how many of them actually started using our service. It's important to note that we only count the first use of the service; all subsequent uses should be disregarded.
Regardless of when they first started using the service, users will still belong to the same cohort as the week they registered. For instance, if a user registered in week 1 but only started using the service two weeks later in week 3, they should still be categorized under Cohort week 1.
Below, you'll find a sample dataset and the desired outcome. Thank you very much everyone for your help!
Data
Result
Solved! Go to Solution.
You can use the following DAX measure to get the desired result:
User Started Walking =
// List of distinct users who walked (Irrespective of any week). The answer is 5
VAR _walkers =
SUMMARIZE (
FILTER ( ALL ( EventData ), EventData[Event type] = "Walk" ),
EventData[User Name]
)
// List of distinct users who registered in the current week in context
VAR _registered =
SUMMARIZE (
FILTER ( EventData, EventData[Event type] = "Registration" ),
EventData[User Name]
)
// List of users who walked and registered in the current week in context
VAR _startedWalking =
INTERSECT ( _walkers, _registered )
RETURN
COUNTROWS ( _startedWalking ) // Just couning the users who walked and registered in the current week
To get the user registered in the current week in context, here is the formula:
User Registered =
CALCULATE(
DISTINCTCOUNT(EventData[User Name]),
EventData[Event type] = "Registration"
)
Here is the screenshot of the desired result:
Well, if you want "Week1 registration cohort" then, you can just create a calculated column and use it. The formula would still work.
Best Regards,
Udit
If this post helps, then please consider Accepting it as the solution to help the other members find it more quickly.
Appreciate your Kudo 👍
🚀 Let's Connect: LinkedIn || YouTube || Medium || GitHub
✨ Visit My Linktree: LinkTree
You can use the following DAX measure to get the desired result:
User Started Walking =
// List of distinct users who walked (Irrespective of any week). The answer is 5
VAR _walkers =
SUMMARIZE (
FILTER ( ALL ( EventData ), EventData[Event type] = "Walk" ),
EventData[User Name]
)
// List of distinct users who registered in the current week in context
VAR _registered =
SUMMARIZE (
FILTER ( EventData, EventData[Event type] = "Registration" ),
EventData[User Name]
)
// List of users who walked and registered in the current week in context
VAR _startedWalking =
INTERSECT ( _walkers, _registered )
RETURN
COUNTROWS ( _startedWalking ) // Just couning the users who walked and registered in the current week
To get the user registered in the current week in context, here is the formula:
User Registered =
CALCULATE(
DISTINCTCOUNT(EventData[User Name]),
EventData[Event type] = "Registration"
)
Here is the screenshot of the desired result:
Well, if you want "Week1 registration cohort" then, you can just create a calculated column and use it. The formula would still work.
Best Regards,
Udit
If this post helps, then please consider Accepting it as the solution to help the other members find it more quickly.
Appreciate your Kudo 👍
🚀 Let's Connect: LinkedIn || YouTube || Medium || GitHub
✨ Visit My Linktree: LinkTree
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 |
---|---|
102 | |
101 | |
78 | |
70 | |
63 |
User | Count |
---|---|
140 | |
106 | |
100 | |
83 | |
73 |