Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

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.

Reply
Katch
Regular Visitor

Cohort analysis report - count registrations and first use of service

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

Katch_0-1712891906241.png

Result

Katch_1-1712891950084.png

1 ACCEPTED SOLUTION
quantumudit
Continued Contributor
Continued Contributor

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:

solution.jpg
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

View solution in original post

2 REPLIES 2
quantumudit
Continued Contributor
Continued Contributor

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:

solution.jpg
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

Hi @quantumudit , thank you very much for your help! That works perfectly. 🙂

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.