title: Using condition in Calculatetable ()
body: <p>I've a problem on Table filtering while using CALCULATETABLE()</p>
  
  <p>I tried to use the script with condition for CALCULATETABLE():</p>
  
  <pre><code>XeroInvoices[AmountPaid] &lt; XeroInvoices[AmountDue]      
  
  EVALUATE
  SUMMARIZE(
      CALCULATETABLE(XeroInvoices,
          XeroInvoices[Status] = "AUTHORISED",
          XeroInvoices[DueDate] &lt;=  TODAY(),
          XeroInvoices[AmountPaid] &lt; XeroInvoices[AmountDue]      
              ),
          XeroInvoices[Number],
          XeroInvoices[Reference],
          XeroInvoices[Status],
          XeroInvoices[Date],
          XeroInvoices[DueDate],
          XeroInvoices[AmountPaid],
          XeroInvoices[AmountDue]
          )
  </code></pre>
  
  <p>but the error that i get in DAX Studio is as following:</p>
  
  <pre><code>Query (6, 30) The expression contains multiple columns, but only a single column can be used in a True/False expression that is used as a table filter expression.
  </code></pre>
  
  <p>I managed only to kinda achieve that I wanted only like this -- crating new column within SUMMARIZE() syntax and later filtering it in Excel:</p>
  
  <pre><code>EVALUATE
  SUMMARIZE(
      CALCULATETABLE(XeroInvoices,
          XeroInvoices[Status] = "AUTHORISED",
          XeroInvoices[DueDate] &lt;=  TODAY()       
              ),
          XeroInvoices[Number],
          XeroInvoices[Reference],
          XeroInvoices[Status],
          XeroInvoices[Date],
          XeroInvoices[DueDate],
          XeroInvoices[AmountPaid],
          XeroInvoices[AmountDue],
          "AmPaid&lt;AmDue",XeroInvoices[AmountPaid]&lt; XeroInvoices[AmountDue]
          )
  </code></pre>
  
  <p>Does anyone know what might be the reason for this Err in CALCULATETABLE() and what might be a proposed solution?</p>
  
  <p>Thanks!!</p>