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

Get certified in Microsoft Fabric—for free! For a limited time, get a free DP-600 exam voucher to use by the end of 2024. Register now

Reply
Anonymous
Not applicable

Customer Stickiness - Last Purchase analysis

I wish to create a matrix that shows the number of customers that made purchases in a month while segmenting it against the last purchase date.

 AprilMayJuneJulyAugustSept
0-30 days700520    
31-60 days200180    
61-90 days100140    
91-120 days120160    
121-150 days7050    
151-180 days5020    
180 + days1040    
Total customers12501110    

 

I have tried the below codes, but I am not able to create the exact table.

 

Order Days difference =
VAR Secondlastorder =
    CALCULATE (
        MAX ( 'Sales Data'[Sales Order Date] ),
        FILTER ( 'Sales Data', 'Sales Data'[Sales Order Date] < MAX ( 'Sales Data'[Sales Order Date] ) )
    )
VAR LastOrder =  LASTDATE('Sales Data'[Sales Order Date])

Return DATEDIFF (Secondlastorder,LastOrder,DAY)

 

Order date group = IF([Order Days difference]<=30,"0-30 days",IF([Order Days difference]<=60,"31-60 days",IF([Order Days difference]<=90,"61-90 days",IF([Order Days difference]<=120,"90-120 days",IF([Order Days difference]<=150,"120-150 days","150+")))))
 
I am getting order date groups as values which I want to be shown as row categories.
 
Further, I also wish to create the below table to analyze the order size and frequency by which the customer places an order:
 Q1Q2
Number of Ordersnumber of customersAverage Order valuenumber of customersAverage Order value
170010000  
280012000  
320014000  
440011000  
550020000  
5+100080000  
Total customers3600147000  
 
Kindly guide
2 REPLIES 2
v-jayw-msft
Community Support
Community Support

Hi @Anonymous ,

 

Please share some sample data so that we could test the formula.

 

Best Regards,

Jay

Community Support Team _ Jay
If this post helps, then please consider Accept it as the solution
to help the other members find it.
Anonymous
Not applicable

please find demo table as requested

Billing Doc NoBilling DateSales OrderSales Order DateCustomer Name
2912.04.20222116.03.2022am
3007.05.20222221.03.2022am
3116.04.20222221.03.2022am
3116.04.20222221.04.2022am
3214.04.20222330.03.2022ch
3305.04.20222431.03.2022ch
3305.04.20222431.03.2022ch
3305.04.20222431.03.2022ar
3412.04.20222431.03.2022ar
3412.04.20222531.04.2022ar
3412.04.20222531.04.2022ar
3412.04.20222531.04.2022ar
3412.04.20222531.04.2022ar
3412.04.20222531.04.2022ar
3412.04.20222631.05.2022ar
3412.04.20222631.05.2022ar
3412.04.20222631.05.2022ar
3412.04.20222631.05.2022ar

Helpful resources

Announcements
November Carousel

Fabric Community Update - November 2024

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

Live Sessions with Fabric DB

Be one of the first to start using Fabric Databases

Starting December 3, join live sessions with database experts and the Fabric product team to learn just how easy it is to get started.

Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Early Bird pricing ends December 9th.

Nov PBI Update Carousel

Power BI Monthly Update - November 2024

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