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
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
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
Top Kudoed Authors