title: Power Bi/Dax: Summarize table with filters
body: <p>I have this table:</p>
  
  <pre><code>IP  Technology  Status
  IP1 T1  Passed
  IP1 T1  Passed
  IP1 T1  Failed
  IP1 T2  Failed
  IP1 T2  Failed
  IP1 T2  Passed
  IP2 T3  Passed
  IP2 T3  Failed
  IP3 T4  Passed
  IP3 T4  Passed
  IP3 T5  Passed
  IP3 T5  Passed
  IP3 T5  Passed
  IP3 T5  Passed
  IP3 T5  Passed
  IP2 T6  Passed
  IP2 T6  Passed
  IP2 T6  Passed
  IP2 T6  Passed
  </code></pre>
  
  <p>I have to remove some of the Technology (T2 and T6) and show the following summary table: 
  (I am interested only in the ‘Passed’ results but left the ‘failed’ column for reference)</p>
  
  <pre><code>IP   Failed Passed  100% Passed
  IP1  33%    67%     No
  IP2  50%    50%     No
  IP3  0%     100%    Yes
  </code></pre>
  
  <p>This is what I did:
  I created two temporary tables to calculate the number of passed tests and the total number of tests:</p>
  
  <pre><code>Table1 =
  CALCULATETABLE (
      GROUPBY (
          'Table',
          'Table'[IP],
          'Table'[Status],
          "#Passed", COUNTAX ( CURRENTGROUP (), ( 'Table'[Status] = "Passed" ) )
      ),
      'Table'[Technology] = "T1"
          || 'Table'[Technology] = "T3"
          || 'Table'[Technology] = "T4"
          || 'Table'[Technology] = "T5"
  )
  </code></pre>
  
  <pre><code>Test2 =
  CALCULATETABLE (
      GROUPBY (
          'Table',
          'Table'[IP],
          "#scan", COUNTAX ( CURRENTGROUP (), ( 'Table'[IP] ) )
      ),
      'Table'[Technology] = "T1"
          || 'Table'[Technology] = "T3"
          || 'Table'[Technology] = "T4"
          || 'Table'[Technology] = "T5"
  )
  </code></pre>
  
  <p>In Table1, I added the total number of tests from Table2 using LOOKUPVALUE and calculated the ‘%Passed’.</p>
  
  <p>When I want to get the ‘100% Passed’ flag (Yes/No) using IF statement:</p>
  
  <pre><code>100% Passed = IF(%'Table Test1'[%Passed]=1,"Yes","No")
  </code></pre>
  
  <p>I get this error message:</p>
  
  <p><code>The following syntax error occurred during parsing: invalid token, Line1, Offset 4, %</code></p>
  
  <p>Is it because the ‘%Passed’ is a calculated field?  Do you know a way around?  I’ve been working on this for days and I’m getting frustrated.  Is there a more efficient way to get this result?</p>
  
  <p>Thanks in advance for your help.</p>