<?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: Need to Match Quantities (Supplied vs Ordered) in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Need-to-Match-Quantities-Supplied-vs-Ordered/m-p/1295495#M22349</link>
    <description>&lt;P&gt;It reads The syntax for 'Return' is incorrect.&lt;/P&gt;&lt;P&gt;DAX(VAR __SuppliedQuantity = SUMX(FILTER('Table',[Order Number] = EARLIER('Table'[Order Number]) &amp;amp;&amp;amp; [Order Line] = EARLIER('Table'[Order Line]),[Supplied Quantity])&lt;BR /&gt;RETURN&lt;BR /&gt;IF([Ordered Quantity] = __SuppliedQuantity,1,0)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;It start marking a mistake right after Sumx. I believe thats because Sumx(table,expression) ?&lt;/P&gt;</description>
    <pubDate>Fri, 14 Aug 2020 07:10:52 GMT</pubDate>
    <dc:creator>pratichi</dc:creator>
    <dc:date>2020-08-14T07:10:52Z</dc:date>
    <item>
      <title>Need to Match Quantities (Supplied vs Ordered)</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Need-to-Match-Quantities-Supplied-vs-Ordered/m-p/1295249#M22338</link>
      <description>&lt;P&gt;I have a Table&amp;nbsp;&lt;/P&gt;&lt;TABLE border="1"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;Shipment No&lt;/TD&gt;&lt;TD&gt;Shipment&lt;BR /&gt;Line no&lt;/TD&gt;&lt;TD&gt;Order&amp;nbsp; Number&lt;/TD&gt;&lt;TD&gt;Order&lt;BR /&gt;Line no&lt;/TD&gt;&lt;TD&gt;Item Name&lt;/TD&gt;&lt;TD&gt;Supplied Quantity&lt;/TD&gt;&lt;TD&gt;Ordered Quantity&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;S1&lt;/TD&gt;&lt;TD&gt;1&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;O1&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;1&lt;/TD&gt;&lt;TD&gt;Item A&lt;/TD&gt;&lt;TD&gt;5&lt;/TD&gt;&lt;TD&gt;10&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;S1&lt;/TD&gt;&lt;TD&gt;2&lt;/TD&gt;&lt;TD&gt;O1&lt;/TD&gt;&lt;TD&gt;2&lt;/TD&gt;&lt;TD&gt;Item B&lt;/TD&gt;&lt;TD&gt;10&lt;/TD&gt;&lt;TD&gt;10&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;S2&lt;/TD&gt;&lt;TD&gt;1&lt;/TD&gt;&lt;TD&gt;O1&lt;/TD&gt;&lt;TD&gt;1&lt;/TD&gt;&lt;TD&gt;Item A&lt;/TD&gt;&lt;TD&gt;5&lt;/TD&gt;&lt;TD&gt;10&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;S3&lt;/TD&gt;&lt;TD&gt;1&lt;/TD&gt;&lt;TD&gt;O2&lt;/TD&gt;&lt;TD&gt;1&lt;/TD&gt;&lt;TD&gt;Item C&lt;/TD&gt;&lt;TD&gt;10&lt;/TD&gt;&lt;TD&gt;10&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I want to check for every line in an order, the total shipped quantity is equal to the Order Quantity.&lt;/P&gt;&lt;P&gt;So for O1, Line 1, 10 units are order and if all 10 units have been supplied irrelevant of the no. of shipments.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;As you can see item A in Order O1 has been shipped in 2 different shipments.&lt;/P&gt;&lt;P&gt;Since the order quantity is always going to show 10 for a particular order, irrespective to the supplied quantity, I am unable to figure out how can I match the supplied vs ordered quantity at the Order level.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I was thinking Concatenate Order-Item Name-Order line No. Then check Sum of Supplied quantity vs First/last of Ordered quantity but not sure how the formula would be.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm still a rookie in power BI and from a non-IT background, so any assistance on this would be very helpful.&lt;/P&gt;&lt;P&gt;Thanks in advance.&lt;/P&gt;&lt;P&gt;I see&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="313" data-lia-user-login="Greg_Deckler" class="lia-mention lia-mention-user"&gt;Greg_Deckler&lt;/a&gt;&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="148838" data-lia-user-login="amitchandak" class="lia-mention lia-mention-user"&gt;amitchandak&lt;/a&gt;&amp;nbsp; are amongst the best and kind on this forum, can you please guide me in the right direction.&lt;/P&gt;</description>
      <pubDate>Fri, 14 Aug 2020 05:47:14 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Need-to-Match-Quantities-Supplied-vs-Ordered/m-p/1295249#M22338</guid>
      <dc:creator>pratichi</dc:creator>
      <dc:date>2020-08-14T05:47:14Z</dc:date>
    </item>
    <item>
      <title>Re: Need to Match Quantities (Supplied vs Ordered)</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Need-to-Match-Quantities-Supplied-vs-Ordered/m-p/1295339#M22343</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="200278" data-lia-user-login="pratichi" class="lia-mention lia-mention-user"&gt;pratichi&lt;/a&gt;&amp;nbsp;- You could create a calculated column like the following:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;In Full = 
  VAR __SuppliedQuantity = SUMX(FILTER('Table',[Order Number] = EARLIER('Table'[Order Number]) &amp;amp;&amp;amp; [Order Line] = EARLIER('Table'[Order Line]),[Supplied Quantity])
RETURN
  IF([Ordered Quantity] = __SuppliedQuantity,1,0)&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Ones have been supplied in full, zeros have not.&lt;/P&gt;</description>
      <pubDate>Fri, 14 Aug 2020 06:14:46 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Need-to-Match-Quantities-Supplied-vs-Ordered/m-p/1295339#M22343</guid>
      <dc:creator>Greg_Deckler</dc:creator>
      <dc:date>2020-08-14T06:14:46Z</dc:date>
    </item>
    <item>
      <title>Re: Need to Match Quantities (Supplied vs Ordered)</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Need-to-Match-Quantities-Supplied-vs-Ordered/m-p/1295342#M22344</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="200278" data-lia-user-login="pratichi" class="lia-mention lia-mention-user"&gt;pratichi&lt;/a&gt; , see it this measure work for remaining qty &lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;sumx(Summarize(Table, table[Order Number],Table[Order Line no], Table[Item Name], "_1", sum(Table[Supplied Quantity]), "_2",max(Table[Ordered Quantity])),[_2]-[_1])&lt;/P&gt;</description>
      <pubDate>Fri, 14 Aug 2020 06:15:53 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Need-to-Match-Quantities-Supplied-vs-Ordered/m-p/1295342#M22344</guid>
      <dc:creator>amitchandak</dc:creator>
      <dc:date>2020-08-14T06:15:53Z</dc:date>
    </item>
    <item>
      <title>Re: Need to Match Quantities (Supplied vs Ordered)</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Need-to-Match-Quantities-Supplied-vs-Ordered/m-p/1295495#M22349</link>
      <description>&lt;P&gt;It reads The syntax for 'Return' is incorrect.&lt;/P&gt;&lt;P&gt;DAX(VAR __SuppliedQuantity = SUMX(FILTER('Table',[Order Number] = EARLIER('Table'[Order Number]) &amp;amp;&amp;amp; [Order Line] = EARLIER('Table'[Order Line]),[Supplied Quantity])&lt;BR /&gt;RETURN&lt;BR /&gt;IF([Ordered Quantity] = __SuppliedQuantity,1,0)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;It start marking a mistake right after Sumx. I believe thats because Sumx(table,expression) ?&lt;/P&gt;</description>
      <pubDate>Fri, 14 Aug 2020 07:10:52 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Need-to-Match-Quantities-Supplied-vs-Ordered/m-p/1295495#M22349</guid>
      <dc:creator>pratichi</dc:creator>
      <dc:date>2020-08-14T07:10:52Z</dc:date>
    </item>
    <item>
      <title>Re: Need to Match Quantities (Supplied vs Ordered)</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Need-to-Match-Quantities-Supplied-vs-Ordered/m-p/1296274#M22375</link>
      <description>&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="csharp"&gt;// Returns True if item
// has been fully shipped.
// False if not. I assume
// that it's not possible
// to ship more than Ordered
// Quantity
[Shipped All] =  // calculated column, not a measure
var __orderNo = T[Order Number]
var __itemName = T[Item Name]
VAR __totalSupplied =
    SUMX(
        FILTER(
            T,
            T[Order Number] = __orderNo
            &amp;amp;&amp;amp;
            T[Item Name] = __itemName
        ),
        T[Supplied Quantity]
    )
RETURN
  ( T[Ordered Quantity] = __totalSupplied )&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 14 Aug 2020 11:32:01 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Need-to-Match-Quantities-Supplied-vs-Ordered/m-p/1296274#M22375</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2020-08-14T11:32:01Z</dc:date>
    </item>
    <item>
      <title>Re: Need to Match Quantities (Supplied vs Ordered)</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Need-to-Match-Quantities-Supplied-vs-Ordered/m-p/2297372#M56647</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="313" data-lia-user-login="Greg_Deckler" class="lia-mention lia-mention-user"&gt;Greg_Deckler&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;When I apply this calculated column I get an error:&lt;/P&gt;&lt;P&gt;&amp;lt;pi&amp;gt;A circular dependency was detected: Table_Order[Pending Order].&amp;lt;/pi&amp;gt;&lt;/P&gt;&lt;P&gt;What am I missing?&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Fernando&lt;/P&gt;</description>
      <pubDate>Mon, 24 Jan 2022 00:13:53 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Need-to-Match-Quantities-Supplied-vs-Ordered/m-p/2297372#M56647</guid>
      <dc:creator>calerof</dc:creator>
      <dc:date>2022-01-24T00:13:53Z</dc:date>
    </item>
    <item>
      <title>Re: Need to Match Quantities (Supplied vs Ordered)</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Need-to-Match-Quantities-Supplied-vs-Ordered/m-p/2297375#M56648</link>
      <description>&lt;P&gt;I've got it. I was using an explicit measure for quantity. When changed for the Quantity column it works magic.&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;F&lt;/P&gt;</description>
      <pubDate>Mon, 24 Jan 2022 00:19:50 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Need-to-Match-Quantities-Supplied-vs-Ordered/m-p/2297375#M56648</guid>
      <dc:creator>calerof</dc:creator>
      <dc:date>2022-01-24T00:19:50Z</dc:date>
    </item>
  </channel>
</rss>

