title: DAX DEFINE returns column not found error
body: <p>This works:</p>
  <pre><code>EVALUATE
  ADDCOLUMNS(
      FILTER (Sales, [StoreKey] = 155 ) ,
      &quot;Margin&quot;, (Sales[SalesAmount] - Sales[TotalCost])
  )
  </code></pre>
  <p>However, if I try to define a function, I get an error:</p>
  <pre><code>DEFINE VAR Margin = Sales[SalesAmount] - Sales[TotalCost]
  EVALUATE
  ADDCOLUMNS(
      FILTER (Sales, [StoreKey] = 155) ,
      &quot;Margin&quot;, Margin
  )
  </code></pre>
  <blockquote>
  <p>Query (1, 21) A single value for column 'SalesAmount' in table 'Sales'
  cannot be determined. This can happen when a measure formula refers to
  a column that contains many values without specifying an aggregation
  such as min, max, count, or sum to get a single result.</p>
  </blockquote>
  <p>What is this error and how to fix it?</p>