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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
awff
Helper III
Helper III

Lost customers in the last year

Hi All, 

Below is a small sample of a single client's renewal term:

 

awff_1-1647219010940.png

 

You can see that "New Customer?" is yes for the first term

 

But the "Lost Customer?" doesn't seem to be returning the correct value. All rows should be "no" except the last row which should be "yes" as there is no start date for 2020 onwards.

 

Below is the calculated column measure used in the table.

 

Lost Customer? = //Customer is lost when no maintenance in the following 12 months
VAR a = 
    RANKX (
        FILTER (
            '_fact (Quote)',
            '_fact (Quote)'[AccountID] = EARLIER ( '_fact (Quote)'[AccountID] ) &&
            year('_fact (Quote)'[Start_Date__c]) <= year('_fact (Quote)'[Start_Date__c]) -1 &&
            '_fact (Quote)'[QuoteStatus (invoiceRequested)] = "Invoiced"
        ),
        '_fact (Quote)'[Start_Date__c],
        ,
        ASC,
        DENSE
    )
RETURN
IF ( a = 1 && '_fact (Quote)'[QuoteStatus (invoiceRequested)] = "Invoiced", "yes", if('_fact (Quote)'[QuoteStatus (invoiceRequested)] <> "Invoiced", blank(), "no"))

 Any assistance is appreciated!

1 ACCEPTED SOLUTION
v-yangliu-msft
Community Support
Community Support

Hi  @awff ,

Here are the steps you can follow:

1. In Power query. Add Column – Index Column – From 1.

vyangliumsft_0-1647409464130.png

2. Create calculated column.

Lost customer =
var _current='Table'[End date]
var _next=CALCULATE(MAX('Table'[Start Date]),FILTER(ALL('Table'),'Table'[Index]=EARLIER('Table'[Index])+1))
return
IF(
    _next-_current<=365,"no","yes")

3. Result:

vyangliumsft_1-1647409464131.png

 

Best Regards,

Liu Yang

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly

View solution in original post

3 REPLIES 3
v-yangliu-msft
Community Support
Community Support

Hi  @awff ,

Here are the steps you can follow:

1. In Power query. Add Column – Index Column – From 1.

vyangliumsft_0-1647409464130.png

2. Create calculated column.

Lost customer =
var _current='Table'[End date]
var _next=CALCULATE(MAX('Table'[Start Date]),FILTER(ALL('Table'),'Table'[Index]=EARLIER('Table'[Index])+1))
return
IF(
    _next-_current<=365,"no","yes")

3. Result:

vyangliumsft_1-1647409464131.png

 

Best Regards,

Liu Yang

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly

amitchandak
Super User
Super User

@awff , A new column

new column =

var _max  = minx(filter(Table, Table[Customer] = earlier([Customer]) && [End Date]>  earlier([End date]) ), [Customer])

return

Switch(True(),  [End Date] >= today() , "No " ,

[End Date] < today() && isblank(_max) , "Yes", "No")

Hi @amitchandak 

 

Thank you for your help! I notice the current formula is dynamic in that if the client is a returning customer, the results would change.

Is there a way the formula can be modified to be absolute so that I am able to get a fixed month on month count of attrition?

 

A lost customer would be defined as:
no renewal since the end date after 1 year (365 days).

 

In the below example, the second renewal was a two year term, but did not renew for 2021, and would be lost.

 

after 1 year they return in 2022 and is recognised as a new customer?

 

CustomerStart DateEnd dateNew customer?Lost customer?
Example pty ltd1/01/20171/01/2018yesno
Example pty ltd1/01/20181/01/2020noyes
Example pty ltd1/01/20221/01/2023yesno

 

Apolgies if i have confused..

Helpful resources

Announcements
LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.