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

Grow your Fabric skills and prepare for the DP-600 certification exam by completing the latest Microsoft Fabric challenge.

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
Europe Fabric Conference

Europe’s largest Microsoft Fabric Community Conference

Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.

RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.

Top Solution Authors