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

The Power BI DataViz World Championships are on! With four chances to enter, you could win a spot in the LIVE Grand Finale in Las Vegas. Show off your skills.

Reply
Anonymous
Not applicable

Calculate Churn Rate From Two Dates

I'm trying to create a churn measure that will be the percentage of claims that are canceled in a selected year. If I selected 2023 as the date, I would want to see that the churn rate is 50%. This means that 1 out of the 4 policies that were active in 2023 ended before the year was over.

 

 

ChannelCategoryPaymentMethodCurrentSalesAgentNum_ClaimsPolicyStartDatePolicyEndDate
Channel1Credit CardJohn Doe11/20/20232/23/2024
Channel2Credit CardJane Doe19/3/202110/7/2021
Channel3Credit CardJohn Doe12/9/20233/15/2024
Channel1Credit CardJane Doe19/23/202110/22/2022
Channel2Credit CardJohn Doe13/1/20234/4/2024
Channel3VisFinJane Doe110/13/202111/16/2021
Channel1Credit CardJohn Doe13/21/20234/24/2023
Channel2Check(ACH)Jane Doe2.511/2/202112/6/2021
Channel3Credit CardJohn Doe2.54/10/20235/14/2023
Channel1Credit CardJane Doe2.511/22/202112/26/2021
Channel2VisFinJohn Doe2.54/30/20236/3/2023
Channel3Credit CardJane Doe2.512/12/20211/15/2022
2 ACCEPTED SOLUTIONS
amitchandak
Super User
Super User

@Anonymous , Create an independent date table  and use that in the slicer

 

//Date1 is independent Date table
Active measure =
var _max = maxx(allselected(Date1),Date1[Date])
var _min = minx(allselected(Date1),Date1[Date])
return
calculate( sum(Table[Value]), filter('Table', 'Table'[Start Date] <=_max && 'Table'[End Date] >=_min))

 

 

Inactive measure =
var _max = maxx(allselected(Date1),Date1[Date])
var _min = minx(allselected(Date1),Date1[Date])
return
calculate( sum(Table[Value]), filter('Table', 'Table'[End Date] <=_max && 'Table'[End Date] >=_min))

 

Now you can have a ratio

 

Need of an Independent Date Table:https://www.youtube.com/watch?v=44fGGmg9fHI

Full Power BI Video 20 Hours YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

View solution in original post

Hi,

You may download my PBI file from here.

Hope this helps.

Untitled.png


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

View solution in original post

6 REPLIES 6
Anonymous
Not applicable

This looks great! What is the date range of the independent table? Based on the policyStartdate and policyenddate ranges?

You are welcome.  There is no independent table there - both Tables are related via the Date column.  Please study the steps in the Query Editor to see the transofrmation carried out on the Data Table.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/
Ashish_Mathur
Super User
Super User

Hi,

Please explain how you arrived at 25% (based on the sample data that you have shared).


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/
Anonymous
Not applicable

Apologies, this should be 50%. 3 of them started and ended in 2023 while another 3 started in 2023 but didn't end until after 2023. It should be 3/6 = 50%

Hi,

You may download my PBI file from here.

Hope this helps.

Untitled.png


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/
amitchandak
Super User
Super User

@Anonymous , Create an independent date table  and use that in the slicer

 

//Date1 is independent Date table
Active measure =
var _max = maxx(allselected(Date1),Date1[Date])
var _min = minx(allselected(Date1),Date1[Date])
return
calculate( sum(Table[Value]), filter('Table', 'Table'[Start Date] <=_max && 'Table'[End Date] >=_min))

 

 

Inactive measure =
var _max = maxx(allselected(Date1),Date1[Date])
var _min = minx(allselected(Date1),Date1[Date])
return
calculate( sum(Table[Value]), filter('Table', 'Table'[End Date] <=_max && 'Table'[End Date] >=_min))

 

Now you can have a ratio

 

Need of an Independent Date Table:https://www.youtube.com/watch?v=44fGGmg9fHI

Full Power BI Video 20 Hours YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

FebPBI_Carousel

Power BI Monthly Update - February 2025

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

Feb2025 NL Carousel

Fabric Community Update - February 2025

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

Top Kudoed Authors