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
kzmlbyrk
Regular Visitor

identify lost customers using snapshotted data

Hello,

 

There are two monthly snapshotted tables as shared below.

I need to create a new column in the customers table.
This column needs to show whether or not the customer has zero active units left in that snapshot while at least one active contract in the previous snapshot.

 

In the example below, the customer with ID 10 was left with zero active contracts on snapshot 202203 while having 1 active contract on 202202; and was flagged as a lost customer on 202203.

 

CustomerIDYearMonth column is the key between the two tables.

 

Thanks in advance!

 

Contracts table

Snapshot Year MonthCustomer IDCustomerIDYearMonthContract IDIs Active Contract of This MonthIs Termination of This Month
20220110102022011TRUEFALSE
20220210102022021TRUEFALSE
20220310102022031FALSETRUE
20220410102022041FALSEFALSE
20220110102022012TRUEFALSE
20220210102022022FALSETRUE
20220310102022032FALSEFALSE
20220410102022042FALSEFALSE
20220120202022013TRUEFALSE
20220220202022023TRUEFALSE
20220320202022033TRUEFALSE
20220420202022043TRUEFALSE
20220120202022014TRUEFALSE
20220220202022024TRUEFALSE
20220320202022034TRUEFALSE
20220420202022044TRUEFALSE

 

Customers table 

Snapshot Year MonthCustomer IDCustomerIDYearMonthIs Lost Customer of This Month (Desired Result)
2022011010202201FALSE
2022021010202202FALSE
2022031010202203TRUE
2022041010202204FALSE
2022012020202201FALSE
2022022020202202FALSE
2022032020202203FALSE
2022042020202204FALSE
1 REPLY 1
amitchandak
Super User
Super User

@kzmlbyrk , refer if these approaches can help, you need join the date table on the snapshot date (you can create date using year month)

 

date = date( left([Snapshot Year Month],4) ,right([Snapshot Year Month],2),1)

 

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

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.