<?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 Percent Customers Who Returned 90 days after First Purchase in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Percent-Customers-Who-Returned-90-days-after-First-Purchase/m-p/4412312#M175231</link>
    <description>&lt;P&gt;I am trying to create DAX expressions to determine the percentage of customers that returned 90 days after their first purchase and also determine the percentage of customers that returned 3 months after the first 90 days.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;There is a Customers Table which has the following columns: CustomerKey, DateFirstPurchase and there is a Sales Table which has the following columns: CustomerKey, OrderDate.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Below is the end result expected from the full data to be a reference for the ask and the file of the data is uploaded as well.&amp;nbsp; I have been able to determine the first 2 columns of the expected results, but need help on the percentages in the 3rd and 4th columns.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Link to PowerBI&lt;/P&gt;&lt;P&gt;&lt;A href="https://1drv.ms/u/s!AqrMerNw9bjFgUDFIg6rj7tzc3PL?e=HCKZcC" target="_self"&gt;PowerBI Data&amp;nbsp;&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have tried the following DAX measure to get the percent of customers who returned after 90 days, but I am not receiving the correct results. I am unsure what I am missing.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Purchase within 90days(%) =&lt;/P&gt;&lt;P&gt;VAR Customerlist = VALUES( Sales[CustomerKey] )&lt;/P&gt;&lt;P&gt;VAR Returndate = 90&lt;/P&gt;&lt;P&gt;VAR CountCustomers = COUNTROWS( FILTER( Customerlist,&lt;/P&gt;&lt;P&gt;CALCULATE( COUNTROWS (Sales),&lt;/P&gt;&lt;P&gt;FILTER( ALLSELECTED ( 'Calendar' ),&lt;/P&gt;&lt;P&gt;'Calendar'[Date] &amp;gt; ( MIN ( Sales[OrderDate] ) ) &amp;amp;&amp;amp; 'Calendar'[Date] &amp;lt; MIN ( Sales[OrderDate]) + Returndate ) ) &amp;gt;0 ) )&lt;/P&gt;&lt;P&gt;Return DIVIDE(CountCustomers,[Customers]) ​&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Thanks!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;</description>
    <pubDate>Sun, 16 Feb 2025 03:11:30 GMT</pubDate>
    <dc:creator>akzimmerman</dc:creator>
    <dc:date>2025-02-16T03:11:30Z</dc:date>
    <item>
      <title>Percent Customers Who Returned 90 days after First Purchase</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Percent-Customers-Who-Returned-90-days-after-First-Purchase/m-p/4412312#M175231</link>
      <description>&lt;P&gt;I am trying to create DAX expressions to determine the percentage of customers that returned 90 days after their first purchase and also determine the percentage of customers that returned 3 months after the first 90 days.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;There is a Customers Table which has the following columns: CustomerKey, DateFirstPurchase and there is a Sales Table which has the following columns: CustomerKey, OrderDate.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Below is the end result expected from the full data to be a reference for the ask and the file of the data is uploaded as well.&amp;nbsp; I have been able to determine the first 2 columns of the expected results, but need help on the percentages in the 3rd and 4th columns.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Link to PowerBI&lt;/P&gt;&lt;P&gt;&lt;A href="https://1drv.ms/u/s!AqrMerNw9bjFgUDFIg6rj7tzc3PL?e=HCKZcC" target="_self"&gt;PowerBI Data&amp;nbsp;&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have tried the following DAX measure to get the percent of customers who returned after 90 days, but I am not receiving the correct results. I am unsure what I am missing.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Purchase within 90days(%) =&lt;/P&gt;&lt;P&gt;VAR Customerlist = VALUES( Sales[CustomerKey] )&lt;/P&gt;&lt;P&gt;VAR Returndate = 90&lt;/P&gt;&lt;P&gt;VAR CountCustomers = COUNTROWS( FILTER( Customerlist,&lt;/P&gt;&lt;P&gt;CALCULATE( COUNTROWS (Sales),&lt;/P&gt;&lt;P&gt;FILTER( ALLSELECTED ( 'Calendar' ),&lt;/P&gt;&lt;P&gt;'Calendar'[Date] &amp;gt; ( MIN ( Sales[OrderDate] ) ) &amp;amp;&amp;amp; 'Calendar'[Date] &amp;lt; MIN ( Sales[OrderDate]) + Returndate ) ) &amp;gt;0 ) )&lt;/P&gt;&lt;P&gt;Return DIVIDE(CountCustomers,[Customers]) ​&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Thanks!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;</description>
      <pubDate>Sun, 16 Feb 2025 03:11:30 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Percent-Customers-Who-Returned-90-days-after-First-Purchase/m-p/4412312#M175231</guid>
      <dc:creator>akzimmerman</dc:creator>
      <dc:date>2025-02-16T03:11:30Z</dc:date>
    </item>
    <item>
      <title>Re: Percent Customers Who Returned 90 days after First Purchase</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Percent-Customers-Who-Returned-90-days-after-First-Purchase/m-p/4412343#M175234</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="928763" data-lia-user-login="akzimmerman" class="lia-mention lia-mention-user"&gt;akzimmerman&lt;/a&gt;&amp;nbsp; Try the below measures:&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Total Customers = COUNTROWS(Customers)&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Customers Returning 90 Days = 
COUNTROWS(
    FILTER(
        Customers,
        VAR FirstPurchase = Customers[DateFirstPurchase]
        VAR EndDate90 = FirstPurchase + 90
        RETURN
            CALCULATE(
                COUNTROWS(Sales),
                Sales[OrderDate] &amp;gt; FirstPurchase,
                Sales[OrderDate] &amp;lt;= EndDate90
            ) &amp;gt; 0
    )
)&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;% Returning Within 90 Days = 
DIVIDE(
    [Customers Returning 90 Days],
    [Total Customers]
)&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Customers Returning 90-180 Days = 
COUNTROWS(
    FILTER(
        Customers,
        VAR FirstPurchase = Customers[DateFirstPurchase]
        VAR StartDate90 = FirstPurchase + 90
        VAR EndDate180 = FirstPurchase + 180
        RETURN
            CALCULATE(
                COUNTROWS(Sales),
                Sales[OrderDate] &amp;gt; StartDate90,
                Sales[OrderDate] &amp;lt;= EndDate180
            ) &amp;gt; 0
    )
)&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;% Returning 90-180 Days = 
DIVIDE(
    [Customers Returning 90-180 Days],
    [Total Customers]
)&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Hope this helps!!&lt;/P&gt;
&lt;P&gt;If this solved your problem, please accept it as a solution!!&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Best Regards,&lt;BR /&gt;Shahariar Hafiz&lt;/P&gt;</description>
      <pubDate>Sun, 16 Feb 2025 05:07:49 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Percent-Customers-Who-Returned-90-days-after-First-Purchase/m-p/4412343#M175234</guid>
      <dc:creator>shafiz_p</dc:creator>
      <dc:date>2025-02-16T05:07:49Z</dc:date>
    </item>
    <item>
      <title>Re: Percent Customers Who Returned 90 days after First Purchase</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Percent-Customers-Who-Returned-90-days-after-First-Purchase/m-p/4647728#M177895</link>
      <description>&lt;P&gt;Were you able to figure this out? I'm stuck on it too and have tried several changes to my formula&lt;/P&gt;</description>
      <pubDate>Thu, 10 Apr 2025 23:09:41 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Percent-Customers-Who-Returned-90-days-after-First-Purchase/m-p/4647728#M177895</guid>
      <dc:creator>beachwaves18</dc:creator>
      <dc:date>2025-04-10T23:09:41Z</dc:date>
    </item>
  </channel>
</rss>

