<?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 FIFO question in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/FIFO-question/m-p/3720422#M144864</link>
    <description>&lt;P&gt;Hi, I am trying to "assign" pending orders to batches based on FIFO.&amp;nbsp; &amp;nbsp;I have 2 tables:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;tblSKU&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;tblPendingOrders&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;I want to add a column to tblSKU showing pending orders.&amp;nbsp; &amp;nbsp;So, with the current pending orders, tblSKU would look like this:&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Looking for the best way to accomplish this with DAX.&amp;nbsp; &amp;nbsp; &amp;nbsp;Thx!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Fri, 23 Feb 2024 17:24:46 GMT</pubDate>
    <dc:creator>JaviGoldstein</dc:creator>
    <dc:date>2024-02-23T17:24:46Z</dc:date>
    <item>
      <title>FIFO question</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/FIFO-question/m-p/3720422#M144864</link>
      <description>&lt;P&gt;Hi, I am trying to "assign" pending orders to batches based on FIFO.&amp;nbsp; &amp;nbsp;I have 2 tables:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;tblSKU&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;tblPendingOrders&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;I want to add a column to tblSKU showing pending orders.&amp;nbsp; &amp;nbsp;So, with the current pending orders, tblSKU would look like this:&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Looking for the best way to accomplish this with DAX.&amp;nbsp; &amp;nbsp; &amp;nbsp;Thx!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 23 Feb 2024 17:24:46 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/FIFO-question/m-p/3720422#M144864</guid>
      <dc:creator>JaviGoldstein</dc:creator>
      <dc:date>2024-02-23T17:24:46Z</dc:date>
    </item>
    <item>
      <title>Re: FIFO question</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/FIFO-question/m-p/3720891#M144885</link>
      <description>&lt;P&gt;Please use a proper logistics planning tool.&amp;nbsp; Power BI has no memory and is incapable of handling material allocation tasks. Its focus is on reporting data.&lt;/P&gt;</description>
      <pubDate>Sat, 24 Feb 2024 01:21:53 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/FIFO-question/m-p/3720891#M144885</guid>
      <dc:creator>lbendlin</dc:creator>
      <dc:date>2024-02-24T01:21:53Z</dc:date>
    </item>
    <item>
      <title>Re: FIFO question</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/FIFO-question/m-p/3722928#M144982</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="641188" data-lia-user-login="JaviGoldstein" class="lia-mention lia-mention-user"&gt;JaviGoldstein&lt;/a&gt;&amp;nbsp;,&lt;BR /&gt;Here us my test data:&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;Create a calculate column&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Pending Orders = 
VAR tblPO = 
    CALCULATE(
        MAX(tblPendingOrders[Amount]),
        FILTER(
            tblPendingOrders,
            tblPendingOrders[SKU] = tblSKU[SKU]
        )
    )
VAR temp_result = 
    IF(
        (tblPO-tblSKU[Balance]) &amp;gt;= 0,
        tblPO-tblSKU[Balance],
        0
    )
RETURN
IF(
    (temp_result - tblSKU[Balance]) &amp;gt; 0,
    temp_result - tblSKU[Balance],
    IF(
        tblPO &amp;gt; tblSKU[Balance],
        IF(
            tblSKU[Batch] = 1,
            tblSKU[Balance],
            temp_result
        ),
        temp_result
    )
)&lt;/LI-CODE&gt;
&lt;P&gt;Final output&lt;/P&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;Albert He&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&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;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 26 Feb 2024 06:19:42 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/FIFO-question/m-p/3722928#M144982</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2024-02-26T06:19:42Z</dc:date>
    </item>
    <item>
      <title>Re: FIFO question</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/FIFO-question/m-p/3727886#M145231</link>
      <description>&lt;P&gt;Anonymous&lt;/a&gt;&amp;nbsp;this is perfect.&amp;nbsp; &amp;nbsp;THANKS!&amp;nbsp; &amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 27 Feb 2024 14:09:32 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/FIFO-question/m-p/3727886#M145231</guid>
      <dc:creator>JaviGoldstein</dc:creator>
      <dc:date>2024-02-27T14:09:32Z</dc:date>
    </item>
    <item>
      <title>Re: FIFO question</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/FIFO-question/m-p/3727890#M145232</link>
      <description>&lt;P&gt;not using this as a logistics solution.&amp;nbsp; &amp;nbsp;Reporting only.&amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 27 Feb 2024 14:10:48 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/FIFO-question/m-p/3727890#M145232</guid>
      <dc:creator>JaviGoldstein</dc:creator>
      <dc:date>2024-02-27T14:10:48Z</dc:date>
    </item>
  </channel>
</rss>

