<?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 Amount of sales in tbl_A after the delivery date of a product from tbl_B in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Amount-of-sales-in-tbl-A-after-the-delivery-date-of-a-product/m-p/3584327#M138278</link>
    <description>&lt;P&gt;Hey All!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm stuck with the following problem. I'm trying to see what the Sales for customers are in tbl_A before &amp;amp; after the customer recieved a promo product.&amp;nbsp;&lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;BR /&gt;&lt;BR /&gt;tbl_A contains the order_received_date &amp;amp; customer_id.&lt;/P&gt;&lt;P&gt;tbl_B contains the promo_sent_date &amp;amp; customer_id.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;2 fact tables (tbl_A &amp;amp; tbl_B) linked by date &amp;amp; customer dimension tables. (Star Schema).&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Many Thanks,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Taylor&lt;/P&gt;</description>
    <pubDate>Thu, 14 Dec 2023 16:14:16 GMT</pubDate>
    <dc:creator>Ttaylor9870</dc:creator>
    <dc:date>2023-12-14T16:14:16Z</dc:date>
    <item>
      <title>Amount of sales in tbl_A after the delivery date of a product from tbl_B</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Amount-of-sales-in-tbl-A-after-the-delivery-date-of-a-product/m-p/3584327#M138278</link>
      <description>&lt;P&gt;Hey All!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm stuck with the following problem. I'm trying to see what the Sales for customers are in tbl_A before &amp;amp; after the customer recieved a promo product.&amp;nbsp;&lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;BR /&gt;&lt;BR /&gt;tbl_A contains the order_received_date &amp;amp; customer_id.&lt;/P&gt;&lt;P&gt;tbl_B contains the promo_sent_date &amp;amp; customer_id.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;2 fact tables (tbl_A &amp;amp; tbl_B) linked by date &amp;amp; customer dimension tables. (Star Schema).&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Many Thanks,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Taylor&lt;/P&gt;</description>
      <pubDate>Thu, 14 Dec 2023 16:14:16 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Amount-of-sales-in-tbl-A-after-the-delivery-date-of-a-product/m-p/3584327#M138278</guid>
      <dc:creator>Ttaylor9870</dc:creator>
      <dc:date>2023-12-14T16:14:16Z</dc:date>
    </item>
    <item>
      <title>Re: Amount of sales in tbl_A after the delivery date of a product from tbl_B</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Amount-of-sales-in-tbl-A-after-the-delivery-date-of-a-product/m-p/3584657#M138299</link>
      <description>&lt;P&gt;Combine that 2 tables, so the new table will have the following columns:&lt;/P&gt;&lt;P&gt;Client ID/ Sales Date/ Sales amount/ Promotion date&lt;/P&gt;&lt;P&gt;Add a Custom column, and some simple code like (if Sales Date &amp;gt; promotion date, then AFTER, else then BEFORE). I'm not good at coding, hope you understand what I mean.&lt;/P&gt;&lt;P&gt;And then you can use the Maxtrix Visual to sort out BEFORE/ AFTER easily.&lt;/P&gt;</description>
      <pubDate>Thu, 14 Dec 2023 21:28:19 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Amount-of-sales-in-tbl-A-after-the-delivery-date-of-a-product/m-p/3584657#M138299</guid>
      <dc:creator>Tom_Y</dc:creator>
      <dc:date>2023-12-14T21:28:19Z</dc:date>
    </item>
    <item>
      <title>Re: Amount of sales in tbl_A after the delivery date of a product from tbl_B</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Amount-of-sales-in-tbl-A-after-the-delivery-date-of-a-product/m-p/3595948#M138937</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="415490" data-lia-user-login="Ttaylor9870" class="lia-mention lia-mention-user"&gt;Ttaylor9870&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;According to your description, here are my steps you can follow as a solution.&lt;/P&gt;
&lt;P&gt;(1) This is my test data.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;(2) We can create a calculated column.&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Column = 
var _date=CALCULATE(MAX('tbl_B'[promo_sent_date]),FILTER('tbl_B',[customer_id] = EARLIER('tbl_A'[customer_id])))
var _sales=CALCULATE(MAX('tbl_B'[sales]),FILTER('tbl_B',[customer_id] = EARLIER('tbl_A'[customer_id])))
RETURN IF([order_received_date]&amp;gt;=_date,_sales,[sales])&lt;/LI-CODE&gt;
&lt;P&gt;(3) Then the result is as follows.&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If the above one can't help you get the desired result, please provide some&amp;nbsp;&lt;STRONG&gt;sample data&lt;/STRONG&gt;&amp;nbsp;in your tables (&lt;STRONG&gt;exclude&amp;nbsp;sensitive&amp;nbsp;data&lt;/STRONG&gt;) with&amp;nbsp;&lt;STRONG&gt;Text&lt;/STRONG&gt;&amp;nbsp;format and your&amp;nbsp;&lt;STRONG&gt;expected result&lt;/STRONG&gt;&amp;nbsp;with backend logic and special examples.&amp;nbsp;&lt;STRONG&gt;It is better&lt;/STRONG&gt;&amp;nbsp;if you can share a&amp;nbsp;&lt;STRONG&gt;simplified&lt;/STRONG&gt;&amp;nbsp;pbix file.&amp;nbsp;Thank you.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Best Regards,&lt;/P&gt;
&lt;P&gt;Neeko Tang&lt;/P&gt;
&lt;P&gt;If this post  &lt;STRONG&gt;helps&lt;/STRONG&gt;, then please consider &lt;STRONG&gt;&lt;EM&gt;Accept it as the solution &lt;/EM&gt;&lt;/STRONG&gt; to help the other members find it more quickly.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 21 Dec 2023 08:38:17 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Amount-of-sales-in-tbl-A-after-the-delivery-date-of-a-product/m-p/3595948#M138937</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2023-12-21T08:38:17Z</dc:date>
    </item>
  </channel>
</rss>

