March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Early bird discount ends December 31.
Register NowBe one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now
Hi all,
I am a bit stuck with a difficult DAX function and I just can't get my head around it so maybe you guys can help me.
I want to define new customers and old customers, starting from the year 2020.
New customer = When a customer is in the first 12 months of its first purchase. So, customer buys in January 2020 and in the following 12 months this customer is categorized as a "new customer"
Old customer = When a customer is still making purchases after the 12 months prior.
I already made the following command but this is only categorizing the new customers as customers who haven't bought anything in the months prior. However, when they did their first purchase in January, they are not a new customer in the following months.
I hope you guys can help me on this
Solved! Go to Solution.
Hi, @Martijn1204 ;
Please follow these steps:
(1)This is my test data :
(2) Create a measure to count the new customer
CountNewCustomer =
VAR _old =
SUMMARIZE (
FILTER (
'ClientRevenueProfitByService_v5',
'ClientRevenueProfitByService_v5'[Date] <= EDATE ( TODAY (), -12 )
&& 'ClientRevenueProfitByService_v5'[Sales] <> BLANK ()
),
'ClientRevenueProfitByService_v5'[ClientNameConsolidated]
)
VAR _new =
SUMMARIZE (
FILTER (
'ClientRevenueProfitByService_v5',
'ClientRevenueProfitByService_v5'[Date] > EDATE ( TODAY (), -12 )
),
'ClientRevenueProfitByService_v5'[ClientNameConsolidated]
)
RETURN
COUNTROWS ( EXCEPT ( _new, _old ) )
(3) The result is as follows :
If this method does not meet your needs, you can provide us with your special sample data and the desired output sample data in the form of tables, so that we can better help you solve the problem.
Best Regards,
Gallen Luo
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi, @Martijn1204 You can read this article here, it is well described how to identify new customers
https://www.daxpatterns.com/new-and-returning-customers/
Hi,
I also found this article but I can't find that they define "new customers" as customers who purchased something in the first 12 months of their purchase. I now how to define "new customers" as customers who purchased something for the first time in month A. And when it is month B, these customers aren't defined as "new customers".
The definitions are flawed.
I want to define new customers and old customers, starting from the year 2020.
New customer = When a customer is in the first 12 months of its first purchase. So, customer buys in January 2020 and in the following 12 months this customer is categorized as a "new customer"
Old customer = When a customer is still making purchases after the 12 months prior.
When a customer made their first purchase on day A, month B, then regardless of what the customer had been doing in the next 11 months, they are classified as "new" in the very next 11 months (plus the month on which they made their first purchase, of course). What happens after the 11th month after the purchase? What is the classification? Does it depend on whether the customer has made a purchase after the 11th month or not? If they did, then they are "old" and if not, they're still "new" or already "old"? It's not clear.
Hi,
After the 11th months after their first purchase they move to the category "Old customers". It does not matter if they made a purchase after the 11 months. A new customer moves to the category "Old customer" after 11 months no matter what. If they bought something in the 10th month, they are categorised as "new customer", and if the next time that they buy something is 3 months after the 10th month, they are categorised as "old customer".
Hope this makes it more clear.
Yeah... I think I now do understand the logic. Thanks for clarification. By the way, is it possible for you to give us some kind of data representative of your problem to work with? If so, please place a link to the file here.
Hi,
Thankyou alot, this really helps.
Apologies for the late reaction as I had to tackle some urgent projects.
This is exactly what I needed but there is an exception.
If their first purchase was on 01/01/2000, they are a "new customer" until 01/01/2001 (period of 12 months). But if they haven't bought anything in the upcoming 12 months, so from 01/01/2001 till 01/01/2002. They switch from "new customer" to "support customer". Do you think this is also possible?
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!
Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.
Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.
User | Count |
---|---|
23 | |
16 | |
15 | |
7 | |
6 |
User | Count |
---|---|
33 | |
29 | |
16 | |
13 | |
12 |