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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
bml123
Post Patron
Post Patron

Lost, retained and new customers year on year

Hi,

 

I have a requirement to get the number of clients lost, retained and new customers when comparing an year's figures against previous year's figures. 

Lost is when they appear in previous year and not appearing in current year

Retained - when they appear in previous and current year

New - when they appear in current year and not in previous year

 

How do I achieve that?

2 REPLIES 2
v-jingzhang
Community Support
Community Support

Hi @bml123 

 

What data or columns do you already have in the source table? Can you please provide some dummy data for us to use? 

 

If you want to use a measure to calculate the results, you can first use two variable tables in them to get the customer ids in each year separately. Then use EXCEPT and INTERSECT to compare two years' values. For those exist in two variable tables, they are retained customers. For those only exist in one variable table, they are new or lost customers. Count the numbers of above customers and you will get the result you want. 

 

Best Regards,
Community Support Team _ Jing
If this post helps, please Accept it as Solution to help other members find it.

vanessafvg
Super User
Super User

the brilliant folks at sqlbi have created these patterns for this purpose.

 

https://www.daxpatterns.com/new-and-returning-customers/

 

you can adjust the code to your liking

vanessafvg_0-1655408607773.png

 

 

the briliant sqlbi crew have created patterns specifically to assist with this.





If I took the time to answer your question and I came up with a solution, please mark my post as a solution and /or give kudos freely for the effort 🙂 Thank you!

Proud to be a Super User!




Helpful resources

Announcements
PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.