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 am trying to build a report that shows customers who did not order within the last month. They want to see the customers who haven't ordered anything from the dates of Nov 29 2021 to Dec 27 2021 of active customers who did not order anything. Any help would be great! Thanks!
Solved! Go to Solution.
Hi @Anonymous ,
You can try this
Lost Customers =
VAR _CurrentDate = MAX('Date'[Date])
VAR _1MonthsAgo = EOMONTH(_CurrentDate, -1)
VAR _Last1MonthCustomers =
CALCULATETABLE(
VALUES(Sales[Customer_ID]),
DATESINPERIOD('Date'[Date], _CurrentDate, -1, MONTH)
)
VAR _BeforeLast1MonthCustomers =
CALCULATETABLE(
VALUES(Sales[Customer_ID]),
REMOVEFILTERS('Date'[Date]),
'Date'[Date] <= _1MonthsAgo
)
VAR _LostCustomers = EXCEPT(_BeforeLast1MonthCustomers, _Last1MonthCustomers)
RETURN
COUNTROWS(_LostCustomers)
You can have a look at this video.
https://www.youtube.com/watch?v=m1uupRDWzQw
https://radacad.com/lost-customers-dax-calculation-for-power-bi
Regards,
Harsh Nathani
Hi @Anonymous ,
You can try this
Lost Customers =
VAR _CurrentDate = MAX('Date'[Date])
VAR _1MonthsAgo = EOMONTH(_CurrentDate, -1)
VAR _Last1MonthCustomers =
CALCULATETABLE(
VALUES(Sales[Customer_ID]),
DATESINPERIOD('Date'[Date], _CurrentDate, -1, MONTH)
)
VAR _BeforeLast1MonthCustomers =
CALCULATETABLE(
VALUES(Sales[Customer_ID]),
REMOVEFILTERS('Date'[Date]),
'Date'[Date] <= _1MonthsAgo
)
VAR _LostCustomers = EXCEPT(_BeforeLast1MonthCustomers, _Last1MonthCustomers)
RETURN
COUNTROWS(_LostCustomers)
You can have a look at this video.
https://www.youtube.com/watch?v=m1uupRDWzQw
https://radacad.com/lost-customers-dax-calculation-for-power-bi
Regards,
Harsh Nathani
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 |
---|---|
106 | |
94 | |
77 | |
65 | |
53 |
User | Count |
---|---|
145 | |
105 | |
104 | |
90 | |
63 |