Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
2 years ago
Solved

Urgent HELP needed!!!

Hello Team, I'm currently working on creating a report on customer churn. Here are some points I need your help in:  I need to calculate the total number of customers I had in the previous year, ...
  • Anonymous's avatar
    Anonymous
    2 years ago

    Hi Anonymous ,

     

    Thanks for the reply from GilbertQ , please allow me to provide another insight: 

     

    1. Create a measure to get the number of customers whose revenue and quantity were not zero in the previous year.

    previous year total =
    CALCULATE(DISTINCTCOUNT('Sample table'[Customer ID]),FILTER(ALL('Sample table'),'Sample table'[T-DI-A: Calendar Year] = SELECTEDVALUE(' Sample table'[T-DI-A: Calendar Year]) - 1 && 'Sample table'[Total Revenue] <> 0 && 'Sample table'[Total Volume - Liters] <> 0))

     

    2. Create a measure to get the churn customers.

    churn customers =
    VAR _pre_revenue = CALCULATE(SUM('Sample table'[Total Revenue]),FILTER(ALL('Sample table'),'Sample table'[T-DI-A: Calendar Year] = SELECTEDVALUE('Sample table'[T-DI-A: Calendar Year]) - 1 && 'Sample table'[Customer ID] = MAX('Sample table'[Customer ID]) ))
    RETURN
    IF(_pre_revenue <> 0 && SUM('Sample table'[Total Revenue]) = 0,1,0)

     

    3. Put churn customers into the filter to show the data with result 1.

     

    If your Current Period does not refer to this, please clarify in a follow-up reply.

     

    Best Regards,

    Clara Gong

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