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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
sudheerbolla
Helper II
Helper II

Need running total in Cohort Analysis

 

Policy Attrition Count:

The following table obtained:

POLICY ATTRITION MATRIX (COHORT ANALYSIS)

sudheerbolla_0-1688425075048.png

 

Description of output: In Apr-2023, 1456 no of new policies were taken, out of 1456 new policies, 20 no of policies were cancelled in Apr-2023, and 63 no of policies were cancelled in May-2023 excluding the 20 no of policies cancelled in Apr-2023.

The above output obtained by using the following DAX function

Policy Attrition =

VAR vCurrentMonthAfter = SELECTEDVALUE(Tenure_Table[Value])

VAR vCurrentCohort = SELECTEDVALUE(Consolidated[Cohort])

VAR vleft =

CALCULATE(

    [NewPolicies],

    FILTER(

        Consolidated,

        EOMONTH(Consolidated[PolicyCancelDateColumn],0)=EOMONTH(vCurrentCohort,vCurrentMonthAfter)

    )

)

RETURN

vleft

 

 

Tenure_Table = GENERATESERIES(0,24,1)

 

 

Cohort =

VAR vPolicyNo = Consolidated[POLICY_NUMBER (Imported)]

VAR vResult = CALCULATE(

    EOMONTH(MIN([PolicyPurcDateColumn]),0),

    FILTER(Consolidated,Consolidated[POLICY_NUMBER (Imported)]=vPolicyNo)

)

RETURN

vResult

 

NewPolicies = DISTINCTCOUNT(Consolidated[POLICY_NUMBER (Imported)])

 

 

 

How to get the cumulative policies cancelled output as below. How to write the dax function to get the following output

 

POLICY RETENTION MATRIX (COHORT ANALYSIS)

 

sudheerbolla_1-1688425136167.png

 

 

 

 

 

 

The above out put will help  me in creating the retention matrix, by substracting the retention matrix values from the new policies count.

 

sudheerbolla_2-1688425178159.png

 

 

4 REPLIES 4
amitchandak
Super User
Super User

@sudheerbolla , Make sure the Month year is coming from the date table and, number is coming from Tenure_Table table in matrix 

 

Then try a measure like

Cumm over Tenure_Table

calculate([NewPolicies], filter(all(Tenure_Table), Tenure_Table[Value] <= Max(Tenure_Table[Value])))

 

You can also consider the window function

Continue to explore Power BI Window function Rolling, Cumulative/Running Total, WTD, MTD, QTD, YTD, FYTD: https://youtu.be/nxc_IWl-tTc

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

I appreciate you reply, thank you very much. My doubt is:

how to connect the tenure table to the main consolidated table. To which parameter in consolidated table the value attribute in tenure table to be matched. Here is my model

sudheerbolla_0-1688442374522.png

my consolidated table

sudheerbolla_1-1688442458506.pngsudheerbolla_2-1688442513944.pngsudheerbolla_3-1688442547034.png

 

I appreciate you reply, thank you very much. My doubt is:

how to connect the tenure table to the main consolidated table. To which parameter in consolidated table the value attribute in tenure table to be matched. Here is my model

sudheerbolla_0-1688442374522.png

my consolidated table

sudheerbolla_1-1688442458506.pngsudheerbolla_2-1688442513944.pngsudheerbolla_3-1688442547034.png

 

I appreciate you reply, thank you very much. My doubt is:

how to connect the tenure table to the main consolidated table. To which parameter in consolidated table the value attribute in tenure table to be matched. Here is my model

sudheerbolla_0-1688442374522.png

my consolidated table

sudheerbolla_1-1688442458506.pngsudheerbolla_2-1688442513944.pngsudheerbolla_3-1688442547034.png

 

Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

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

Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors