title: M Query Table.Group with Min based on two columns
body: <p>I have a table with many columns. Three of these columns are:</p>
  <ul>
  <li>Package Name (text)</li>
  <li>Units Required (Int.64)</li>
  <li>Assessment (Int.64)</li>
  </ul>
  <p>What I am trying to do is to find the 'Minimum' &quot;Package Name&quot; first by selecting the smallest number of &quot;Units Required&quot;, then because sometimes there are several instances where the number of required units will be the same, the row with the lowest &quot;Assessment&quot;.</p>
  <p>I am exploring the Table.Group() approach but I am not getting anywhere with my understanding of it. I am doing this in Power Query in Excel 365.</p>
  <p>Psuedo Code would be something like:</p>
  <ul>
  <li>Table.Group(&quot;Previous Step Name&quot;,{&quot;Package Name&quot;},{MIN(&quot;Units Required&quot;),MIN(&quot;Assessment&quot;)})</li>
  </ul>
  <p>As an aside - is it possible to use a single Table.Group and group at two levels? such as &quot;Package Name&quot; and &quot;Column X&quot; so that the result would be a: for each &quot;Package Name&quot; then for each &quot;Column X&quot; in each &quot;Package Name&quot; (nested as it were).</p>
  <p>Thankyou in advance for taking a look at this.</p>
  <p>Any help greatly appreciated.</p>
  <p>Cheers</p>
  <p>The Frog</p>