Forum Discussion

ivancespedesl's avatar
7 years ago

Client status over time

Hi,

 

I would like to get a measure that could tell me if a customer 'deserted' (changing his status from S to N comparing two periods). I tried using one of the solutions in another similar question but it didnt work. My data is quite simple. For this matter I only need to use Date, User ID, Status.

Thanks in advance,

 

IC

2 Replies

  • dax's avatar
    dax
    Community Support

    Hi ivancespedesl,

     

    Based on your description, I didn’t know the logic of “customer 'deserted'”, how to determine the customer 'deserted'? If possible, could you please explain this in details? If you want to compare “S” and “N” ‘s period(calculate date difference), if date difference >10, then show “yes” else show “no” You could try to use below measure to see whether it works or not

     

    Measure 10 =
    VAR t =
        CALCULATE (
            MIN ( Table5[date] ),
            FILTER (
                ( Table5 ),
                Table5[status] = "n"
                    && Table5[userid] = MIN ( Table5[userid] )
            )
        )
    VAR d =
        CALCULATE (
            MIN ( Table5[date] ),
            FILTER (
                ( Table5 ),
                Table5[status] = "s"
                    && Table5[userid] = MIN ( Table5[userid] )
            )
        )
    RETURN
        IF ( DATEDIFF ( t, d, DAY ) <= 10, "yes", "no" )

    Best Regards,

    Zoe Zhi

     

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

    • Hi,

       

      To clarify the matter let's explain the desired result:

       

      IF Customer_Status on the last period was S and now it is S, 'Active'

      IF Customer_Status on the last period was N and now it is N, 'Inactive'

      IF Customer_Status on the last period was S and now it is N, 'Deserted'

      IF Customer_Status on the last period was N and now it is S, 'Reactivated'

       

      This tracking must be done through the Customer ID that remains constant with the client over time.