title: Row number in Dax
body: <p>I have following DAX code. I need auto increment row number where FileNo and CI_No code are same. I tired with RANKX function but it return rank as 1 for all records. Any one have any idea how we can achieve this using DAX.</p>
  <p>Thanks in advance.</p>
  <p>Dax code:</p>
  <pre><code>DEFINE
  VAR A = UNION(   ROW (&quot;FileNo&quot;,  10, &quot;CI_No&quot;, 101, &quot;Amount&quot; ,100)
                  ,ROW (&quot;FileNo&quot;,  10, &quot;CI_No&quot;, 101, &quot;Amount&quot; ,100)
                  ,ROW (&quot;FileNo&quot;,  10, &quot;CI_No&quot;, 101, &quot;Amount&quot; ,100)
                  ,ROW (&quot;FileNo&quot;,  20, &quot;CI_No&quot;, 201, &quot;Amount&quot; ,200)
                  ,ROW (&quot;FileNo&quot;,  20, &quot;CI_No&quot;, 201, &quot;Amount&quot; ,200)
                  ,ROW (&quot;FileNo&quot;,  20, &quot;CI_No&quot;, 301, &quot;Amount&quot; ,300))
  
  
  VAR B=  ADDCOLUMNS(A,
           &quot;RowNo&quot;, RANKX(
          FILTER(A,
                 [FileNo]=EARLIER([FileNo]) &amp;&amp;  [CI_No]=EARLIER([CI_No]) 
                  ),
          [Amount], , DESC
          )        )
   
   EVALUATE B
  </code></pre>
  <p>Expected Result</p>
  <p><a href="https://i.stack.imgur.com/g3M6N.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/g3M6N.png" alt="enter image description here" /></a></p>