Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

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.

Reply
Ibrahimxix
Helper I
Helper I

LOST CUSTOMER FOR 2 MONTH

HI ALL

Ihave one issue as shown below

I need to find the lost customer for 2 month ago ( customers didn't buy from us during 2 month ago )

can any one help me on that 

Abbreviations:  

invd= invoice date 

name = customer name 

 

this is dax code :

LOST Customers11 =
var CustomersPurchased =CALCULATE(VALUES('Apttdsls4069s401PitemPCust'[Name]),
FILTER(ALL(Apttdsls4069s401PitemPCust[t_invd]),
'Apttdsls4069s401PitemPCust'[t_invd]> MIN('Apttdsls4069s401PitemPCust'[t_invd])- 365 &&
'Apttdsls4069s401PitemPCust'[t_invd]<MIN('Apttdsls4069s401PitemPCust'[t_invd])- 60 ))
var PriorCustomers = CALCULATETABLE(VALUES(Apttdsls4069s401PitemPCust[Name]),
FILTER(ALL('Apttdsls4069s401PitemPCust'[t_invd]),
'Apttdsls4069s401PitemPCust'[t_invd]>MIN('Apttdsls4069s401PitemPCust'[t_invd])-60 &&
'Apttdsls4069s401PitemPCust'[t_invd]<MIN('Apttdsls4069s401PitemPCust'[t_invd])))
return
COUNTROWS(EXCEPT(  CustomersPurchased ,PriorCustomers))*-1

 

 

Ibrahimxix_0-1664178790098.png

thanks  

2 REPLIES 2
amitchandak
Super User
Super User

@Ibrahimxix , Customer buying from use for last 2 months

 

2 Months =
var _max = if(isfiltered('Date'),MAX( 'Date'[Date]) , today())
var _min = date(Year(_max), month(_max) -2, Day(_max))+1
BLANK())
return
CALCULATE([net] ,DATESBETWEEN('Date'[Date],_min,_max))

 

or

 

2 Months =
var _max = eomonth(if(isfiltered('Date'),MAX( 'Date'[Date]) , today()),0)
var _min = eomonth(_max,-2)+1 ,
return
CALCULATE([net] ,DATESBETWEEN('Date'[Date],_min,_max))

 

 

Then customer did not buy

 

Countx(Values(Customer[Customer]), if(isblank([2 Months]) , [Customer], Blank()) )

 

For more information refer my blog na video

 

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...

 

 

Customer Retention with Dynamic Segmentation, New/Lost/Retain Customer Count: https://www.youtube.com/watch?v=W4EF1f_k6iY

i did what you told me but  this result came to me 

Ibrahimxix_0-1664182745200.pngIbrahimxix_1-1664182776513.png

 

Ibrahimxix_2-1664182839925.png

 

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.

Top Solution Authors