title: Convert DAX if statement to Power Query (or M)?
body: <p>I need to create a calculated column in order to filter a Tabular model table with the following structure:</p>
  
  <p><strong>Table1</strong></p>
  
  <pre><code>| ID  | Attr A    | Attr B | Value |
  |-----|-----------|--------|-------|
  | 123 | text here | blah   | 130   |
  | 123 | blah      | blah   | 70    |
  | 456 | blah      | blah   | 90    |
  | 456 | blah      | blah   | 110   |
  </code></pre>
  
  <p>And I want the following new column to be created:</p>
  
  <pre><code>| ID  | Attr A    | Attr B | Value | MaxValue |
  |-----|-----------|--------|-------|----------|
  | 123 | text here | blah   | 130   | TRUE     |
  | 123 | blah      | blah   | 70    | FALSE    |
  | 456 | blah      | blah   | 90    | FALSE    |
  | 456 | blah      | blah   | 110   | TRUE     |
  </code></pre>
  
  <p>I would like to create a calculated column using Power Query equivalent to the following DAX statement which returns TRUE if the <strong>Values</strong> column is the largest for a given <strong>ID</strong>, FALSE otherwise. </p>
  
  <pre><code>= IF(CALCULATE(MAX('Table1'[Value]),ALLEXCEPT('Table1','Table1'[ID])) = 'Table1'[Value], TRUE(), FALSE())
  </code></pre>
  
  <p>P.S. I used the default M language editor to generate an if shell statement so this is similar to what I'm looking for:</p>
  
  <pre><code>= Table.AddColumn(#"Changed Type", "MaxValue", each if [#"[Value]"] = 'some logic here' then true else false)
  </code></pre>