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

Join us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.

Reply
Eyal_H
Regular Visitor

Creating a retention table

I have this table as seen in the picture. 

I'm trying to create a retention table, with the end result being somewhat similar to the example I sent in the second picture.

In my case what I'm trying to do is - 

Above the table i'll have a filter to choose capability_name.

When I choose a capability_name, i'll see a retention table for it, that counts the number of unique companies.

timeline should be on a weekly basis, with the first date being the earliest usage_week for that capability_name (which is when the capability was published)

 

So for example - I choose capability 'A' in the filter, i'll see the retention of unique companies from the earliest usage_week. first week will obviously be 100% as it's the first week, and from that week on i'll see a % of how many companies are still using that capability_name on a weekly basis.

 

What are the steps to achieve this goal?

Screenshot 2024-11-17 at 16.04.07.pngScreenshot 2024-11-17 at 16.02.43.png

4 REPLIES 4
Eyal_H
Regular Visitor

Thank you for the quick reply!
What I'm missing in what you sent is - I don't see the retention data. for example, when you chose capability A, in 1/1/24 - you have a 100% at the beggining on week 1 as expected, but then on week 2, 3 and 4 I'd also expect to see the retention % ( how many unique companies are still using it ).

Anonymous
Not applicable

Hi @Eyal_H ,

 

Sorry for that the information you have provided is not making the problem clear to me.  Is that what you mean? According to my test data, company 1 was there in the first week and company 1 was still there in the second week, so the survival rate is 100%. If that's what you mean, you just need to place the fields as shown below.

vtangjiemsft_1-1731983217651.png

 

vtangjiemsft_0-1731983177747.png

 

If I have misunderstood you, please provide example data, logic and expected results.

 

Refer to:

How to provide sample data in the Power BI Forum

How to Get Your Question Answered Quickly

 

Best Regards,

Neeko Tang

If this post  helps, then please consider Accept it as the solution  to help the other members find it more quickly. 

What I meant was - I was expecting to see an output like this, where you actually see the retention by week:
asd.png

Anonymous
Not applicable

Hi @Eyal_H ,

 

According to your description, here are my steps you can follow as a solution.

(1) This is my test data. 

vtangjiemsft_0-1731898475655.png

(2) Create a date table.

DateTable = 
     CALENDAR(
         MIN('Table'[usage_week]),
         MAX('Table'[usage_week])
     )

vtangjiemsft_1-1731898519223.png

(3) Add a calculated column to your main table.

WeekNumber = WEEKNUM('Table'[usage_week], 2)

(4) Create a measure.

Retention = 
VAR FirstWeek = 
    CALCULATE(
        MIN('Table'[WeekNumber]),
        FILTER(
            ALLSELECTED('Table'),
            'Table'[capability_name] = SELECTEDVALUE('Table'[capability_name])
        )
    )
VAR CurrentWeek = MAX('Table'[WeekNumber])
VAR InitialCount = 
    CALCULATE(
        DISTINCTCOUNT('Table'[company_id]),
        FILTER(
            ALLSELECTED('Table'),
            'Table'[WeekNumber] = FirstWeek &&
            'Table'[capability_name] = SELECTEDVALUE('Table'[capability_name])
        )
    )
VAR CurrentCount = 
    CALCULATE(
        DISTINCTCOUNT('Table'[company_id]),
        FILTER(
            ALLSELECTED('Table'),
            'Table'[WeekNumber] = CurrentWeek &&
            'Table'[capability_name] = SELECTEDVALUE('Table'[capability_name])
        )
    )
RETURN
    DIVIDE(CurrentCount, InitialCount, 0)

vtangjiemsft_2-1731898683617.png

For more details, please refer:

Customer Retention in Power BI: DAX Measures - RADACAD

Customer Retention Part 3: Period Of Stay – Cohort... - Microsoft Fabric Community

Cohort Analysis with Power BI and SQL | by Olubukunola Akinsola | Medium

 

If the above one can't help you get the desired result, please provide some sample data in your tables (exclude sensitive data) with Text format and your expected result with backend logic and special examples. It is better if you can share a simplified pbix file. Thank you.

 

Best Regards,

Neeko Tang

If this post  helps, then please consider Accept it as the solution  to help the other members find it more quickly. 

Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

Check out the June 2025 Power BI update to learn about new features.

June 2025 community update carousel

Fabric Community Update - June 2025

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