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.
Hello,
I am creating column chart by years/yearmonths with customers segmented by their activity:
Active Customer: customer has status 'active' up to 15 month after his order. Measure is OK
Leaving Customer: this 'status' customer acquires when it is exactly 16 months (not 17 and more) after his last order and he is not in 'active' status. Need help with this
Active Customer is calculated below. However i need help with calculation of Leaving Customer
For calculating active customers in selected period (15 months after each order) I was following this guide:
Source table structure:
CustomerEmail | PurchaseDate | Untill 15M (calculated column) |
customer1 | 2018-01-01 | 2019-04-01 |
customer1 | 2018-06-01 | 2019-09-01 |
customer2 | 2016-01-01 | 2017-04-01 |
customer2 | 2020-01-01 | 2021-04-01 |
ActiveCustomer_tmp_measure_TotalRows:
=DISTINCTCOUNT(ActiveCustomer[CustomerEmail])
ActiveCustomers Last15M:=
CALCULATE([ActiveCustomer_tmp_measure_TotalRows];
FILTER(ActiveCustomer;
(ActiveCustomer[PurchaseDate]<=LASTDATE('Calendar'[Date])
&&
ActiveCustomer[Untill 15M]>=FIRSTDATE('Calendar'[Date]))))
Thanks!
Solved! Go to Solution.
@Anonymous - Try this out:
Leaving Customers =
VAR __Today = TODAY()
VAR __Table =
ADDCOLUMNS(
ADDCOLUMNS(
SUMMARIZE('Table',[CustomerEmail],"End15",MAX([Until 15M])),
"16",EOMONTH([End15,1])
),
"Leaving",IF(__Today > [End15] && __Today <=[16],1,0)
)
RETURN
COUNTROWS(FILTER(__Table,[Leaving]=1))
Hi @Anonymous,
I'd like to suggest you take a look at following link about hr employee analytic if it meet your requirement:
HR Data - Slowly Changing Dimensions
Regards,
Xiaoxin Sheng
Hi @Anonymous,
I'd like to suggest you take a look at following link about hr employee analytic if it meet your requirement:
HR Data - Slowly Changing Dimensions
Regards,
Xiaoxin Sheng
@Anonymous - Not exactly following this, so when would those customers be considered inactive?
hello,
active- 0 - 15
leaving - 16
inactive - 17+
inactive is easy to calculate as 'total cumulative' - 'active 17'
problem is just 16 months - customer gets this status when it is 16 months after his order and there were no other orders in this period
it doesnt' count customers but sums revenue and the second measure not works properly
@Anonymous - Try this out:
Leaving Customers =
VAR __Today = TODAY()
VAR __Table =
ADDCOLUMNS(
ADDCOLUMNS(
SUMMARIZE('Table',[CustomerEmail],"End15",MAX([Until 15M])),
"16",EOMONTH([End15,1])
),
"Leaving",IF(__Today > [End15] && __Today <=[16],1,0)
)
RETURN
COUNTROWS(FILTER(__Table,[Leaving]=1))
@Anonymous , not very clear. if customer is inactive if he not coming for last 16 month
example - Measures
purchased in last 16 month
Rolling 16 Sales = CALCULATE(sum(Retail[Qty]),DATESINPERIOD('Date'[Date],max('Date'[Date]),-3,MONTH))
not purchsed in last 16 month
Rolling 16 Not Sold = if(CALCULATE(sum(Retail[Qty]),DATESINPERIOD('Date'[Date],max('Date'[Date]),-3,MONTH)) +0>0,blank(),1)
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 |
---|---|
113 | |
97 | |
84 | |
67 | |
60 |
User | Count |
---|---|
150 | |
120 | |
99 | |
87 | |
68 |