Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
6 years ago
Solved

Customer / Member Tenure

Hello Community.

I am seeking your assistance to create a measure for customer (member) tenure. I would like the mesaure to calculate tenure based on the period of time between 'membership_start_date' and the latest 'order_date'.

 

My example dataset is offered below:

member_namemembership_start_dateorder_datetenure_years_at_last_order
name 110/12/201815/11/20190.93
name 219/05/201418/01/20205.67
name 312/03/201903/12/20190.73
name 113/02/201913/02/20201.00
name 305/08/201802/01/20201.41
name 130/10/201615/03/20203.37
name 222/02/201819/02/20201.99

 

To assist, I have a standard DateKey available to use.

 

I have created a general tenure column that calculates tenure based on 'membership_start_date' up to and including today's date, but I am also interested to evaluate tenure upto and including the 'Last Order' date. This will be useful particularly to evaluate the tenure of members who have cancelled their membership, enabling my team to contact valuable members with a long tenure in particular.

I am seeking your assistance as I have not been able to successfully adapt my general tenure code to suit this new purpose: 

Member Tenure_nmbr (Today) = FLOOR(IF('UNION Transaction Table'[membership_start] < TODAY(), DATEDIFF('UNION Transaction Table'[membership_start], TODAY(), DAY) / 365.25, 0), 1)

 

Thank you for your kind assistance.

  • Hi Anonymous ,

     

    Is this the result you expected?

    Or do you want to calculate by the last order date of each customer?

    I created a pbix to see if it meets your needs.

    Sample .pbix

     

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

2 Replies

  • Greg_Deckler's avatar
    Greg_Deckler
    Community Champion
    Perhaps:

    Member Tenure_nmbr (Today) = FLOOR(IF('UNION Transaction Table'[membership_start] < TODAY(), DATEDIFF('UNION Transaction Table'[membership_start], MAXX(FILTER('Table',[member_name] = EARLIER([member_name])),[order_date]), DAY) / 365.25, 0), 1)
  • V-lianl-msft's avatar
    V-lianl-msft
    Community Support

    Hi Anonymous ,

     

    Is this the result you expected?

    Or do you want to calculate by the last order date of each customer?

    I created a pbix to see if it meets your needs.

    Sample .pbix

     

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