title: DAX Measure PowerPivot: Exclude groups based on subgroup values
body: <p>I am trying to create a measure based on summarizing variables (such as the average "Grams of Material") by Production Group (see data example below).  </p>
  
  <p><img src="https://i.stack.imgur.com/37lXQ.png" alt="Sample Data"></p>
  
  <p>Production Groups contain Products, identified by the Product ID field.  When that Product is finished being produced, it is marked as "Complete" and the "Grams of Material" are entered.</p>
  
  <p>I am able to use the <code>GROUPBY</code> and <code>SUMX</code>, <code>AVERAGEX</code>, <code>CALCULATE</code> and <code>FILTER</code> functions to summarize by groups and exclude certain rows.  However, I do NOT want to summarize any Production Groups that include <strong>Incomplete</strong> Products.  </p>
  
  <p>For instance, in the sample data below, I would not want to see any reporting on Production Group B, as some Products within that group are "Incomplete".   </p>
  
  <p>Please let me know how you might accomplish this.  </p>
  
  <p>Here is some sample code that summarizes by the group I want, but does not exclude the groups with incomplete products.</p>
  
  <pre><code>    averagex(  
          GROUPBY(Table,[Production Group],"Production Group Yield", 
          SUMX(CURRENTGROUP(),[Grams Material])),[Production Group Yield])
  
  </code></pre>
  
  <p>Best,</p>
  
  <p>ML</p>