<?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 follow up orders by product in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculate-follow-up-orders-by-product/m-p/4642396#M177764</link>
    <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I realized that there was a mistake in my example calculations, sorry. For selecting the car all three products should have a count of 1.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;So when car is selected I want to count for every product purchase how many cars there are purchased by the same customer between 1 and 13 months (selected by the months slicer) before the car purchase. On 01-feb-2023 fab purchased a car. The car purchase on 1-jan counts as 1. For the bike he purchased on 04-feb-2023 the car he purchased on 01-jan-2023 counts as 1. Fo&lt;SPAN&gt;r the bus he purchased on 01-dec-2024 the car he purchased on 01-oct-2024 counts as 1.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;</description>
    <pubDate>Tue, 08 Apr 2025 07:21:37 GMT</pubDate>
    <dc:creator>IAmAPowerBIUser</dc:creator>
    <dc:date>2025-04-08T07:21:37Z</dc:date>
    <item>
      <title>Calculate follow up orders by product</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculate-follow-up-orders-by-product/m-p/4641479#M177738</link>
      <description>&lt;P&gt;Hi everybody,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P class=""&gt;I have a table of products with different customer orders, and when a user selects a specific product, I want to calculate the number of follow-up orders made by the same customers for different products, within a specified timeframe defined by a &lt;STRONG&gt;MonthsSlicer&lt;/STRONG&gt;.&lt;/P&gt;&lt;P class=""&gt;&amp;nbsp;&lt;/P&gt;&lt;P class=""&gt;I have already written two DAX measures. They correctly calculate the total number of follow-up orders, but they don't display the correct results per &lt;STRONG&gt;ProductID&lt;/STRONG&gt;. I need help refining these DAX measures to provide the correct numbers for each product.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This is my Product table:&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt; This are the results I obtain with my mesures:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This are the expected results:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;I uploaded my .pbix file on wetransfer to better illustrate the exact situation:&amp;nbsp;&lt;A href="https://we.tl/t-yldWky0H9B" target="_blank" rel="noopener"&gt;https://we.tl/t-yldWky0H9B&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks a lot for any help!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Best&lt;/P&gt;&lt;P&gt;Fabian&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 08 Apr 2025 06:54:04 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculate-follow-up-orders-by-product/m-p/4641479#M177738</guid>
      <dc:creator>IAmAPowerBIUser</dc:creator>
      <dc:date>2025-04-08T06:54:04Z</dc:date>
    </item>
    <item>
      <title>Re: Calculate follow up orders by product</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculate-follow-up-orders-by-product/m-p/4642062#M177755</link>
      <description>&lt;LI-CODE lang="markup"&gt;when a user selects a specific product,&lt;/LI-CODE&gt;
&lt;P&gt;via the disconnected ProductID slicer?&amp;nbsp; What if they select more than one product, or no product?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;within a specified timeframe defined by a MonthsSlicer.&lt;/LI-CODE&gt;
&lt;P&gt;Based on which anchor date?&amp;nbsp; The last purchase date for the selected product(s) ?&lt;/P&gt;</description>
      <pubDate>Tue, 08 Apr 2025 00:12:03 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculate-follow-up-orders-by-product/m-p/4642062#M177755</guid>
      <dc:creator>lbendlin</dc:creator>
      <dc:date>2025-04-08T00:12:03Z</dc:date>
    </item>
    <item>
      <title>Re: Calculate follow up orders by product</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculate-follow-up-orders-by-product/m-p/4642227#M177756</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="557215" data-lia-user-login="IAmAPowerBIUser" class="lia-mention lia-mention-user"&gt;IAmAPowerBIUser&lt;/a&gt;&amp;nbsp;When Car is selected how do you identify which row of Car in the table is the starting point? What is the logic behind Car = 1 in the visual?&lt;/P&gt;</description>
      <pubDate>Tue, 08 Apr 2025 04:19:24 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculate-follow-up-orders-by-product/m-p/4642227#M177756</guid>
      <dc:creator>AntrikshSharma</dc:creator>
      <dc:date>2025-04-08T04:19:24Z</dc:date>
    </item>
    <item>
      <title>Re: Calculate follow up orders by product</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculate-follow-up-orders-by-product/m-p/4642396#M177764</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I realized that there was a mistake in my example calculations, sorry. For selecting the car all three products should have a count of 1.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;So when car is selected I want to count for every product purchase how many cars there are purchased by the same customer between 1 and 13 months (selected by the months slicer) before the car purchase. On 01-feb-2023 fab purchased a car. The car purchase on 1-jan counts as 1. For the bike he purchased on 04-feb-2023 the car he purchased on 01-jan-2023 counts as 1. Fo&lt;SPAN&gt;r the bus he purchased on 01-dec-2024 the car he purchased on 01-oct-2024 counts as 1.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 08 Apr 2025 07:21:37 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculate-follow-up-orders-by-product/m-p/4642396#M177764</guid>
      <dc:creator>IAmAPowerBIUser</dc:creator>
      <dc:date>2025-04-08T07:21:37Z</dc:date>
    </item>
    <item>
      <title>Re: Calculate follow up orders by product</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculate-follow-up-orders-by-product/m-p/4642468#M177765</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;thanks for asking questions for clarification. The product is indeed selected via the disconnected slicer which will be limited to single selection in the final version.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The anchor dates are all purchase dates for the selected product. So I want to check for all purchases of the product, not only the most recent one.&lt;/P&gt;</description>
      <pubDate>Tue, 08 Apr 2025 07:17:13 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculate-follow-up-orders-by-product/m-p/4642468#M177765</guid>
      <dc:creator>IAmAPowerBIUser</dc:creator>
      <dc:date>2025-04-08T07:17:13Z</dc:date>
    </item>
    <item>
      <title>Re: Calculate follow up orders by product</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculate-follow-up-orders-by-product/m-p/4655606#M178229</link>
      <description>&lt;P class="" data-start="57" data-end="291"&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="557215" data-lia-user-login="IAmAPowerBIUser" class="lia-mention lia-mention-user"&gt;IAmAPowerBIUser&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P class="" data-start="57" data-end="291"&gt;&lt;BR data-start="66" data-end="69" /&gt;Could you please provide a clear explanation of your requirement along with the expected result? A bit more context will help us understand what you're trying to achieve and suggest the best approach in Power BI.&lt;/P&gt;
&lt;P class="" data-start="57" data-end="291"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P class="" data-start="293" data-end="300"&gt;Regards,&lt;/P&gt;
&lt;P class="" data-start="293" data-end="300"&gt;B Manikanteswara Reddy&lt;/P&gt;</description>
      <pubDate>Wed, 16 Apr 2025 11:32:46 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculate-follow-up-orders-by-product/m-p/4655606#M178229</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2025-04-16T11:32:46Z</dc:date>
    </item>
    <item>
      <title>Re: Calculate follow up orders by product</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculate-follow-up-orders-by-product/m-p/4656789#M178287</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;thanks everyone for your support!&lt;BR /&gt;I finally came up with a DAX measure myself that calculates the correct solution. If in the future anyone is struggeling with a similar problem this is the solution:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;ProductOrdersAfterSelected_04 =&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;VAR&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IV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/SPAN&gt;&lt;SPAN&gt;CALCULATE&lt;/SPAN&gt;&lt;SPAN&gt; (&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/SPAN&gt;&lt;SPAN&gt;COUNTROWS&lt;/SPAN&gt;&lt;SPAN&gt; ( &lt;/SPAN&gt;&lt;SPAN&gt;'Product'&lt;/SPAN&gt;&lt;SPAN&gt; ),&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/SPAN&gt;&lt;SPAN&gt;FILTER&lt;/SPAN&gt;&lt;SPAN&gt; (&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/SPAN&gt;&lt;SPAN&gt;ALL&lt;/SPAN&gt;&lt;SPAN&gt; ( &lt;/SPAN&gt;&lt;SPAN&gt;'Product'&lt;/SPAN&gt;&lt;SPAN&gt; ),&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/SPAN&gt;&lt;SPAN&gt;'Product'&lt;/SPAN&gt;&lt;SPAN&gt;[CustomerID]&lt;/SPAN&gt;&lt;SPAN&gt; = &lt;/SPAN&gt;&lt;SPAN&gt;CurrentCustomer&lt;/SPAN&gt;&lt;SPAN&gt; &amp;amp;&amp;amp;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/SPAN&gt;&lt;SPAN&gt;'Product'&lt;/SPAN&gt;&lt;SPAN&gt;[ProductID]&lt;/SPAN&gt;&lt;SPAN&gt; = &amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;SelectedProduct&lt;/SPAN&gt;&lt;SPAN&gt; &amp;amp;&amp;amp;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/SPAN&gt;&lt;SPAN&gt;'Product'&lt;/SPAN&gt;&lt;SPAN&gt;[PurchaseDate]&lt;/SPAN&gt;&lt;SPAN&gt; &amp;lt; &lt;/SPAN&gt;&lt;SPAN&gt;CurrentDate&lt;/SPAN&gt;&lt;SPAN&gt; &amp;amp;&amp;amp;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/SPAN&gt;&lt;SPAN&gt;'Product'&lt;/SPAN&gt;&lt;SPAN&gt;[PurchaseDate]&lt;/SPAN&gt;&lt;SPAN&gt; &amp;gt;= &lt;/SPAN&gt;&lt;SPAN&gt;EDATE&lt;/SPAN&gt;&lt;SPAN&gt; ( &lt;/SPAN&gt;&lt;SPAN&gt;CurrentDate&lt;/SPAN&gt;&lt;SPAN&gt;, -&lt;/SPAN&gt;&lt;SPAN&gt;SelectedMaxMonth&lt;/SPAN&gt;&lt;SPAN&gt; ) &amp;amp;&amp;amp;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/SPAN&gt;&lt;SPAN&gt;'Product'&lt;/SPAN&gt;&lt;SPAN&gt;[PurchaseDate]&lt;/SPAN&gt;&lt;SPAN&gt; &amp;lt;= &lt;/SPAN&gt;&lt;SPAN&gt;EDATE&lt;/SPAN&gt;&lt;SPAN&gt; ( &lt;/SPAN&gt;&lt;SPAN&gt;CurrentDate&lt;/SPAN&gt;&lt;SPAN&gt;, -&lt;/SPAN&gt;&lt;SPAN&gt;SelectedMinMonth&lt;/SPAN&gt;&lt;SPAN&gt; )&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; )&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; )&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &lt;/SPAN&gt;&lt;SPAN&gt;RETURN&lt;/SPAN&gt;&lt;SPAN&gt; &amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;HasCarBefore&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;)&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Thu, 17 Apr 2025 06:18:11 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculate-follow-up-orders-by-product/m-p/4656789#M178287</guid>
      <dc:creator>IAmAPowerBIUser</dc:creator>
      <dc:date>2025-04-17T06:18:11Z</dc:date>
    </item>
  </channel>
</rss>

