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

Power BI is turning 10! Let’s celebrate together with dataviz contests, interactive sessions, and giveaways. 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
Anonymous
Not applicable

Hi @Anonymous ,

 

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

 

Best Regards,

Jay

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
Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

Check out the June 2025 Power BI update to learn about new features.

June 2025 community update carousel

Fabric Community Update - June 2025

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