<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Calculate the customer repurchase rate. in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculate-the-customer-repurchase-rate/m-p/3534410#M135807</link>
    <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="645623" data-lia-user-login="fsld53" class="lia-mention lia-mention-user"&gt;fsld53&lt;/a&gt;&amp;nbsp;,&lt;BR /&gt;&lt;BR /&gt;If your requirement is to have only two or more purchases (regardless of the product), you can refer to the following methods:&lt;BR /&gt;First, I will show you the test dataset I used:&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;You can use the following DAX to represent a record of buyback:&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Buybacks = 
IF(
    CALCULATE(
        COUNT('Transaction history'[Customer ID]),
        FILTER(
            'Transaction history',
            'Transaction history'[Customer ID] = EARLIER('Transaction history'[Customer ID])
        )
    ) &amp;gt; 1,
    "Yes",
    "No"
)&lt;/LI-CODE&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;You can then use the following DAX to extract the records identified as Yes into a new table:&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;customers who have repurchased at least once = 
CALCULATETABLE(
    'Transaction history',
    'Transaction history'[Buybacks] = "Yes"
)&lt;/LI-CODE&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;You can also use this DAX to calculate how many customers have made a repurchase in total:&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Count_ID = DISTINCTCOUNT('customers who have repurchased at least once'[Customer ID])&lt;/LI-CODE&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Best Regards,&lt;/P&gt;
&lt;P&gt;Dino Tao&lt;/P&gt;
&lt;P&gt;If this post &lt;EM&gt;&lt;STRONG&gt;helps&lt;/STRONG&gt;&lt;/EM&gt;, then please consider &lt;EM&gt;&lt;STRONG&gt;Accept it as the solution&lt;/STRONG&gt;&lt;/EM&gt; to help the other members find it more quickly.&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;</description>
    <pubDate>Wed, 15 Nov 2023 05:59:39 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2023-11-15T05:59:39Z</dc:date>
    <item>
      <title>Calculate the customer repurchase rate.</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculate-the-customer-repurchase-rate/m-p/3531130#M135674</link>
      <description>&lt;P&gt;I'm looking to calculate, on Power BI, the number of customers who have repurchased at least once from a list of orders.&lt;/P&gt;&lt;P&gt;I have managed to calculate:&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;&lt;P&gt;the total number of customers using the function Total number of customers = DISTINCTCOUNT('Sales Report 2'[Customer ID])&lt;/P&gt;&lt;/LI&gt;&lt;LI&gt;&lt;P&gt;the total number of orders using the function Total number of orders = COUNTROWS(VALUES('Sales Report 2'[Order Reference]))&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;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.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt; &lt;/P&gt;</description>
      <pubDate>Mon, 13 Nov 2023 16:23:09 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculate-the-customer-repurchase-rate/m-p/3531130#M135674</guid>
      <dc:creator>fsld53</dc:creator>
      <dc:date>2023-11-13T16:23:09Z</dc:date>
    </item>
    <item>
      <title>Re: Calculate the customer repurchase rate.</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculate-the-customer-repurchase-rate/m-p/3534338#M135805</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="645623" data-lia-user-login="fsld53" class="lia-mention lia-mention-user"&gt;fsld53&lt;/a&gt;&amp;nbsp;,&lt;BR /&gt;&lt;BR /&gt;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?&lt;BR /&gt;&lt;BR /&gt;Best Regard&lt;BR /&gt;Dino Tao&lt;/P&gt;</description>
      <pubDate>Wed, 15 Nov 2023 05:17:05 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculate-the-customer-repurchase-rate/m-p/3534338#M135805</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2023-11-15T05:17:05Z</dc:date>
    </item>
    <item>
      <title>Re: Calculate the customer repurchase rate.</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculate-the-customer-repurchase-rate/m-p/3534410#M135807</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="645623" data-lia-user-login="fsld53" class="lia-mention lia-mention-user"&gt;fsld53&lt;/a&gt;&amp;nbsp;,&lt;BR /&gt;&lt;BR /&gt;If your requirement is to have only two or more purchases (regardless of the product), you can refer to the following methods:&lt;BR /&gt;First, I will show you the test dataset I used:&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;You can use the following DAX to represent a record of buyback:&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Buybacks = 
IF(
    CALCULATE(
        COUNT('Transaction history'[Customer ID]),
        FILTER(
            'Transaction history',
            'Transaction history'[Customer ID] = EARLIER('Transaction history'[Customer ID])
        )
    ) &amp;gt; 1,
    "Yes",
    "No"
)&lt;/LI-CODE&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;You can then use the following DAX to extract the records identified as Yes into a new table:&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;customers who have repurchased at least once = 
CALCULATETABLE(
    'Transaction history',
    'Transaction history'[Buybacks] = "Yes"
)&lt;/LI-CODE&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;You can also use this DAX to calculate how many customers have made a repurchase in total:&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Count_ID = DISTINCTCOUNT('customers who have repurchased at least once'[Customer ID])&lt;/LI-CODE&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Best Regards,&lt;/P&gt;
&lt;P&gt;Dino Tao&lt;/P&gt;
&lt;P&gt;If this post &lt;EM&gt;&lt;STRONG&gt;helps&lt;/STRONG&gt;&lt;/EM&gt;, then please consider &lt;EM&gt;&lt;STRONG&gt;Accept it as the solution&lt;/STRONG&gt;&lt;/EM&gt; to help the other members find it more quickly.&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 15 Nov 2023 05:59:39 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculate-the-customer-repurchase-rate/m-p/3534410#M135807</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2023-11-15T05:59:39Z</dc:date>
    </item>
  </channel>
</rss>

