Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.
HI all,
I'm facing the problem with counting the number of repeating orders.
The main problem is that if the same customer bought product few times in current month, all his purchases except the first one should also be considered as repeated.
All I managed to do so far is to calculate how many orders are from those who bought anything in previous 5 months:
var datemin = DATEADD(STARTOFMONTH('Calendar'[Date]),-5,MONTH)
var datemax = DATEADD(startOFMONTH('Calendar'[Date]),-1,DAY)
var table1 = CALCULATETABLE(VALUES('Orders'[User_ID]),ALL('Orders'),DATESBETWEEN('Orders'[Date_payed],datemin,datemax))
var ordersrep = CALCULATE(DISTINCTCOUNT('Orders'[Order_ID]),YEAR('Orders'[Date_payed])=MAX('Calendar'[Year]),MONTH('Orders'[Date_payed])=MAX('Calendar'[Month]),'Orders'[User_ID] in (table1))
return
ordersrep
and repeated orders in current month:
var totalorders = CALCULATE(DISTINCTCOUNT('Orders'[Order_ID]),YEAR('Orders'[Date_payed])=MAX('Calendar'[Year]),MONTH('Orders'[Date_payed])=MAX('Calendar'[Month]))
var totalbuyers = CALCULATE(DISTINCTCOUNT('Orders'[User_ID]),YEAR('Orders'[Date_payed])=MAX('Calendar'[Year]),MONTH('Orders'[Date_payed])=MAX('Calendar'[Month]))
return
totalorders-totalbuyers
I can't just sum these two measures though as some orders are included in both. I think I should get the list, not the number, of each, unite it and return distinct count. Further I will need to calculate the sum of such orders But I failed to do so.
Any help?
Hi @m_aa ,
Please share some sample data and expcted result so that you could test DAX formula.
Best Regards,
Jay
@m_aa , There two ways of repeat - 1 is they purchased before duration or, they purchase twice
Purchased in last 6 months
Rolling 6 = CALCULATEDISTINCTCOUNT('Orders'[Order_ID]), DATESINPERIOD('Date'[Date ],MAX('Date'[Date ]),-6,MONTH))
Repeat purchase customer =countx(Values(Customer[Customer]) , if([Rolling]>1, [Customer], blank())
in case it based on duration refer
Customer Retention Part 1:
https://community.powerbi.com/t5/Community-Blog/Customer-Retention-Part-1-Month-on-Month-Retention/b...
Customer Retention Part 2: Period over Period Retention :https://community.powerbi.com/t5/Community-Blog/Customer-Retention-Part-2-Period-over-Period-Retenti...
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
111 | |
97 | |
80 | |
69 | |
59 |
User | Count |
---|---|
150 | |
119 | |
104 | |
87 | |
67 |