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
fsld53
New Member

Calculate the customer repurchase rate.

I'm looking to calculate, on Power BI, the number of customers who have repurchased at least once from a list of orders.

I have managed to calculate:

  • the total number of customers using the function Total number of customers = DISTINCTCOUNT('Sales Report 2'[Customer ID])

  • the total number of orders using the function Total number of orders = COUNTROWS(VALUES('Sales Report 2'[Order Reference]))

Now, I am stuck. I can't seem to calculate the number of customers who have repurchased at least once. I've been searching for days, so if anyone has a solution, I would be more than grateful! Thank you very much.

 

Capture.JPG

2 REPLIES 2
v-junyant-msft
Community Support
Community Support

Hi @fsld53 ,

If your requirement is to have only two or more purchases (regardless of the product), you can refer to the following methods:
First, I will show you the test dataset I used:

vjunyantmsft_0-1700027790965.png

You can use the following DAX to represent a record of buyback:

Buybacks = 
IF(
    CALCULATE(
        COUNT('Transaction history'[Customer ID]),
        FILTER(
            'Transaction history',
            'Transaction history'[Customer ID] = EARLIER('Transaction history'[Customer ID])
        )
    ) > 1,
    "Yes",
    "No"
)

vjunyantmsft_1-1700027810743.png

You can then use the following DAX to extract the records identified as Yes into a new table:

customers who have repurchased at least once = 
CALCULATETABLE(
    'Transaction history',
    'Transaction history'[Buybacks] = "Yes"
)

vjunyantmsft_2-1700027866614.png

You can also use this DAX to calculate how many customers have made a repurchase in total:

Count_ID = DISTINCTCOUNT('customers who have repurchased at least once'[Customer ID])

vjunyantmsft_3-1700027939015.png

 

Best Regards,

Dino Tao

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.







v-junyant-msft
Community Support
Community Support

Hi @fsld53 ,

May I ask, what are your requirements for customers who have repurchased at least once? Do you only need to have two or more purchases (no matter what goods you purchase) to be repurchased, or must you buy the same type of goods twice or more to be considered a repurchase?

Best Regard
Dino Tao

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.

Top Solution Authors