<?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: Machine Capacity Planning in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Machine-Capacity-Planning/m-p/3391846#M127871</link>
    <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="255423" data-lia-user-login="TimmK" class="lia-mention lia-mention-user"&gt;TimmK&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I suggest you to sort your order by Date and Duration. We will&amp;nbsp;prioritize completing the orders which are near the deadline or the shorter duration ones.&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Sort Order by Date and Duration = 
VAR _ADD1 =
    ADDCOLUMNS (
        FILTER ( 'Table', 'Table'[Duration] &amp;lt;= 960 ),
        "Rank",
            VAR _RANK1 =
                RANKX ( 'Table', 'Table'[Duration],, ASC, DENSE )
            VAR _RANK2 =
                RANKX ( 'Table', 'Table'[Date],, ASC, DENSE )
            RETURN
                _RANK2 * 100 + _RANK1
    )
VAR _ADD2 =
    ADDCOLUMNS ( _ADD1, "NewRank", RANKX ( _ADD1, [Rank],, ASC, DENSE ) )
RETURN
    SUMX (
        FILTER ( _ADD2, [Order Key] = EARLIER ( 'Table'[Order Key] ) ),
        [NewRank]
    )&lt;/LI-CODE&gt;
&lt;P&gt;Result is as below. Blank one means that duration is out of machine support.&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;Best Regards,&lt;BR /&gt;Rico Zhou&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If this&amp;nbsp;&lt;SPAN&gt;post helps, then please consider Accept it as the solution to help the other members find it more quickly.&lt;/SPAN&gt;&lt;/P&gt;</description>
    <pubDate>Tue, 22 Aug 2023 07:44:45 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2023-08-22T07:44:45Z</dc:date>
    <item>
      <title>Machine Capacity Planning</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Machine-Capacity-Planning/m-p/3387129#M127642</link>
      <description>&lt;P&gt;I have four machines, each with a capacity of 960 minutes. At any given time, only one job can be processed in a machine. The jobs often have varying processing times in the machine.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The table "SL" provides all the necessary information. It has columns "Date", "Order Key", and "Duration". "Date" is the binding delivery date, "Order Key" is the order number, and "Duration" is the processing time required for each order.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I now want a Power BI DAX Measure that calculates the ideal machine allocation for me, so that as many orders as possible are processed by the deadline (i.e., by the delivery date).&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Is this possible within Power BI? If yes, how?&lt;/P&gt;</description>
      <pubDate>Fri, 18 Aug 2023 10:22:10 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Machine-Capacity-Planning/m-p/3387129#M127642</guid>
      <dc:creator>TimmK</dc:creator>
      <dc:date>2023-08-18T10:22:10Z</dc:date>
    </item>
    <item>
      <title>Re: Machine Capacity Planning</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Machine-Capacity-Planning/m-p/3391846#M127871</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="255423" data-lia-user-login="TimmK" class="lia-mention lia-mention-user"&gt;TimmK&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I suggest you to sort your order by Date and Duration. We will&amp;nbsp;prioritize completing the orders which are near the deadline or the shorter duration ones.&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Sort Order by Date and Duration = 
VAR _ADD1 =
    ADDCOLUMNS (
        FILTER ( 'Table', 'Table'[Duration] &amp;lt;= 960 ),
        "Rank",
            VAR _RANK1 =
                RANKX ( 'Table', 'Table'[Duration],, ASC, DENSE )
            VAR _RANK2 =
                RANKX ( 'Table', 'Table'[Date],, ASC, DENSE )
            RETURN
                _RANK2 * 100 + _RANK1
    )
VAR _ADD2 =
    ADDCOLUMNS ( _ADD1, "NewRank", RANKX ( _ADD1, [Rank],, ASC, DENSE ) )
RETURN
    SUMX (
        FILTER ( _ADD2, [Order Key] = EARLIER ( 'Table'[Order Key] ) ),
        [NewRank]
    )&lt;/LI-CODE&gt;
&lt;P&gt;Result is as below. Blank one means that duration is out of machine support.&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;Best Regards,&lt;BR /&gt;Rico Zhou&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If this&amp;nbsp;&lt;SPAN&gt;post helps, then please consider Accept it as the solution to help the other members find it more quickly.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 22 Aug 2023 07:44:45 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Machine-Capacity-Planning/m-p/3391846#M127871</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2023-08-22T07:44:45Z</dc:date>
    </item>
  </channel>
</rss>

