title: Check if max per category Power BI
body: <p>I am trying to create a column that returns 1 for the Max Rev number. My table looks like this:</p>
  
  <pre><code>Serial#   Enrollment#    Rev#
  1234      0001           0
  1234      0001           1
  2225      0002           0
  9999      0003           0
  9999      0003           1
  9999      0003           2
  9999      0004           0
  </code></pre>
  
  <p>I want my result to look like this:</p>
  
  <pre><code>Serial#   Enrollment#    Rev#   MaxRev
  1234      0001           0      0
  1234      0001           1      1
  2225      0002           0      1
  9999      0003           0      0
  9999      0003           1      0
  9999      0003           2      1
  9999      0004           0      1
  </code></pre>
  
  <p>Here is what I tried:</p>
  
  <pre><code>MaxRev = IF(CVA[Rev#] = CALCULATE(MAX([Rev#]),CVA[Enrollment#] = EARLIER(CVA[Enrollment#])),1,0)
  </code></pre>
  
  <p>But it is not working. Thanks in advance</p>