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
suebayes
Resolver I
Resolver I

Create a percentage measure based on first value of a group to be used as the total

I am creating a cohort analysis of some transactional data.  I've grouped by the first month that the purchase was made and then created order periods for repeated purchases by customers from the first month cohort.  I am trying to track and give measures for retention of customers.  I can show the numbers each month for each cohort, total spend and average spend.  I want to be able to show the retention as a percentage of the first month.

So for cohort 2019-06 it % for order period 2109-06 would be 41/41

For cohort 2019-05, order period would be 2019-05 would be 80/80, for order period 2019/06 would be 5/80 and so forth.  I've tried all sorts but got my head in a pickle.  Any help gratefully received.

Sue

Capture.PNG

1 ACCEPTED SOLUTION

Perfect, I hadn't come back to this until now and it works brilliantly. thank you

View solution in original post

2 REPLIES 2
sturlaws
Resident Rockstar
Resident Rockstar

Hi, @suebayes 

you can solve this by changing the cohort and order period columns to dates, and use a calculated column like this:

Percentage retention =
DIVIDE (
    cohorts[count];
    CALCULATE (
        SUM ( cohorts[count] );
        FILTER (
            ALL ( cohorts );
            cohorts[Cohort] = EARLIER ( cohorts[Cohort] )
                && cohorts[order period] = cohorts[Cohort]
        )
    )
)

Perfect, I hadn't come back to this until now and it works brilliantly. thank you

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.