The ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM.
Get registeredEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.
Hi
I try to calculate the lost customers over time in a specific week. I feel like I am almost there but cannot get it to work. I am for sure overseeing something in the measure, hopefully you can help.
The assumption used it that all customers who have a last sale older than 12 weeks should be considered lost. The measure should be able to present the lost customer in a stack column chart but also show which customers are lost in a matrix table when selecting the period in the chart.
# lost customers week =
var SelectedWeek = SELECTEDVALUE('FS_Vertaling weken naar perioden'[Index - week])
var allcustomers = values(FS_Omzet_uren_all[Groepnaam]) --take all customers
var customerinactiveperiod = CALCULATETABLE( values(FS_Omzet_uren_all[Groepnaam]), --select all customers who match below filter
filter( all( 'FS_Vertaling weken naar perioden'), --remove all date filters
'FS_Vertaling weken naar perioden'[Index - week] > SelectedWeek-12 &&
'FS_Vertaling weken naar perioden'[Index - week] < SelectedWeek)) --take all customers with sales in the last 12 weeks
return
COUNTROWS(
EXCEPT(allcustomers,customerinactiveperiod)) --take all customers and remove all active customers (customers in active period)
This is what I get:
This is what I would expect:
@Khalidc , refer my apporch here
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...
dealing with week refer
Power BI — Week on Week and WTD
https://medium.com/@amitchandak.1978/power-bi-wtd-questions-time-intelligence-4-5-98c30fab69d3
https://community.powerbi.com/t5/Community-Blog/Week-Is-Not-So-Weak-WTD-Last-WTD-and-This-Week-vs-La...
https://www.youtube.com/watch?v=pnAesWxYgJ8
Unfortunately Amit, I tried it but unfortunately doesn't seem te work.
I am working with non-date periods. I have indexed the weeks, which start at week 1 in 2019 (index 1) and counting until today.
The rolling 3 and rolling 9 before 3 seem to give the correct result. However the Lost customer in period remain blank everywhere.
I copied the measures used below. Groepnaam is the customer name which is in the sales transaction table (hence customer/groepnaam is not unique in the table).
Hopefully you see what is missing.
#Rolling 3 =
var MaxIndex = SELECTEDVALUE('FS_Vertaling weken naar perioden'[Index - week])
var MinIndex = MaxIndex - 12
return
calculate('03 FS measures'[Omzet totaal],
Filter (all('FS_Vertaling weken naar perioden'),
'FS_Vertaling weken naar perioden'[Index - week] <= MaxIndex &&
'FS_Vertaling weken naar perioden'[Index - week] > MinIndex))
#Rolling 9 before three =
var MaxIndex = SELECTEDVALUE('FS_Vertaling weken naar perioden'[Index - week])-12
var MinIndex = MaxIndex - 52
return
calculate('03 FS measures'[Omzet totaal],
Filter (all('FS_Vertaling weken naar perioden'),
'FS_Vertaling weken naar perioden'[Index - week] <= MaxIndex &&
'FS_Vertaling weken naar perioden'[Index - week] > MinIndex))
#Lost Customer This Period =
Sumx(VALUES(FS_Omzet_uren_all[Groepnaam]),
if(ISBLANK([#Rolling 3]) && not(ISBLANK([#Rolling 9 before three])) , 1,BLANK()))
User | Count |
---|---|
13 | |
8 | |
6 | |
6 | |
5 |
User | Count |
---|---|
24 | |
14 | |
13 | |
8 | |
8 |