Hi everyone,
In the past I’ve been busy with the Customer Churn but it seems to be that I’ve forgotten some essential parts… Can someone help me with a formula?
TestData:
CustomerID | Start | End |
---|---|---|
1 | 1-1-2015 | 1-1-2020 |
2 | 1-7-2015 | 1-10-2016 |
3 | 1-12-2015 | 1-2-2018 |
4 | 1-2-2016 | 5-10-2016 |
5 | 1-8-2016 | 1-2-2019 |
6 | 1-5-2017 | 1-1-2020 |
7 | 1-11-2017 | 1-8-2018 |
8 | 1-4-2018 | 1-10-2019 |
9 | 25-7-2018 | 25-12-2018 |
10 | 22-11-2018 | 1-1-2019 |
11 | 5-1-2019 | 31-3-2019 |
12 | 5-2-2019 | 1-1-2020 |
13 | 5-4-2019 | 5-6-2019 |
14 | 5-5-2019 | 1-1-2020 |
15 | 5-6-2019 | 1-1-2020 |
Measures:
# Customers = DISTINCTCOUNT(Testdata[Customer_ID])
Active Customers = CALCULATE([# Customers];
FILTER(Testdata; Testdata[Start] <= MAX('Calendar'[Date]));
FILTER(Testdata; Testdata[End] >= MIN('Calendar'[Date])))
First Day Start = FIRSTDATE(Testdata[Start])
Last Date LM = EOMONTH(MAX('Calendar'[Date]);-1)
LostCustomers =
CALCULATE([# Customers];
FILTER(Testdata; Testdata[End] <= MAX('Calendar'[Date])))
NewCustomersTotal =
CALCULATE([# Customers];
FILTER(Testdata; Testdata[Start] <= MAX('Calendar'[Date])))
I would like to have the following endresult:
Year-Month | New | Lost |
---|---|---|
2015-01 | 1 | |
2015-02 | ||
2015-03 | ||
2015-04 | ||
2015-05 | ||
2015-06 | ||
2015-07 | 1 | |
2015-08 | ||
2015-09 | ||
2015-10 | ||
2015-11 | ||
2015-12 | 1 | |
2016-01 | ||
2016-02 | 1 | |
2016-03 | ||
2016-04 | ||
2016-05 | ||
2016-06 | ||
2016-07 | ||
2016-08 | 1 | |
2016-09 | ||
2016-10 | 2 |
I know I have to work with two calculatetables:
-
Current Customers: from First Day Start until Last Date Current Period = MAX(Calendar[Date]
-
Prior Customers: from First Day Start until Last Date Prior Period
and then countrows(except(Current Customers, Prior Customers) but I don’t know exactly how I can write the formula. Can somebody help me?
Thanks in advance,
Cor