Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
3 years ago
Solved

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
  • 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

6 Replies

  • 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

  • Hi,

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

    • Anonymous's avatar
      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%

  • Anonymous's avatar
    Anonymous
    Not applicable

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

    • Ashish_Mathur's avatar
      Ashish_Mathur
      Icon for Super User rankSuper User

      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.