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

Get inspired! Check out the entries from the Power BI DataViz World Championships preliminary rounds and give kudos to your favorites. View the vizzies.

Reply
Anonymous
Not applicable

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.

1 ACCEPTED SOLUTION
V-lianl-msft
Community Support
Community Support

Hi @Anonymous ,

 

Is this the result you expected?

test_Customer-Member-Tenure.PNG

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.

View solution in original post

2 REPLIES 2
V-lianl-msft
Community Support
Community Support

Hi @Anonymous ,

 

Is this the result you expected?

test_Customer-Member-Tenure.PNG

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.

Greg_Deckler
Super User
Super User

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)


Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
Power BI Cookbook Third Edition (Color)

DAX is easy, CALCULATE makes DAX hard...

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.

March2025 Carousel

Fabric Community Update - March 2025

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

Top Kudoed Authors