title: PowerPivot DAX: Identify Max & Min Value per Group
body: <p>I am in need of identifying the maximum and minimum value per a defined group within a PowerPivot connected PivotTable.</p>
  
  <p>Please reference the following base Excel table (posted via ASCII) that is linked to a corresponding PowerPivot table: </p>
  
  <pre><code>-------------------------------------------------
  Customer   |  Store  |  Transaction Sequence No | 
  -------------------------------------------------       
       A           1                  1
       A           1                  2
       A           1                  3
       A           2                  1
       A           2                  2
       B           1                  1
       B           1                  2
       B           2                  1
  </code></pre>
  
  <p>As one can see, there are 2 columns above that uniquely define a <strong>group</strong></p>
  
  <ol>
  <li><strong>Customer</strong></li>
  <li><strong>Store</strong></li>
  </ol>
  
  <p>For each group, there can be one or more transactions, each with an associated 
  <strong>[Transaction Sequence No]</strong> value as also outlined above.</p>
  
  <p>Within the resulting PivotTable via 2 DAX Measures, I would like to list the <strong>minimum</strong> and <strong>maximum [Transaction Sequence No]</strong> value tied to each unique group.</p>
  
  <p>This would result in the following PivotTable:</p>
  
  <pre><code>----------------------------------------------------------------------------
  Customer   |  Store  |  Transaction Sequence No |   Max eq No | Min Seq No |
  ---------------------------------------------------------------------------- 
       A           1                  1                  3           1
       A           1                  2                  3           1
       A           1                  3                  3           1
       A           2                  1                  2           1
       A           2                  2                  2           1
       B           1                  1                  2           1
       B           1                  2                  2           1
       B           2                  1                  1           1
  </code></pre>
  
  <p>Now, it would be important for both of these new DAX measures to be dynamically updated if a user via a slicer or filter decides to apply a filter against the <strong>[Transaction Sequence No]</strong> column.</p>
  
  <p>In this example, if the user opts to <strong>exclude</strong> a <strong>[Transaction Sequence No]</strong> value of <strong>3</strong> via an applied filter, the PivotTable should have its data updated to reflect the new max and min values:</p>
  
  <pre><code>----------------------------------------------------------------------------
  Customer   |  Store  |  Transaction Sequence No |   Max eq No | Min Seq No |
  ---------------------------------------------------------------------------- 
       A           1                  1                  2           1
       A           1                  2                  2           1
       A           2                  1                  2           1
       A           2                  2                  2           1
       B           1                  1                  2           1
       B           1                  2                  2           1
       B           2                  1                  1           1
  </code></pre>
  
  <p>I am having trouble formulating the proper DAX syntax to accomplish this.</p>