title: Power BI - rankx for different categories
body: <p>I have the below two columns and the rank one is the desired results. Basically I want to have it to rank DAYS_OLD based on PRIO.</p>
  
  <pre><code>DAYS_OLD    PRIO    RANK
  643          ST      1
  643          ST      1
  643          ST      1
  387          2       1
  318          HM      1
  315          HM      2
  295          HM      3
  263          2       2
  241          ST      2
  235          HM      4
  235          2       3
  232          2       4
  </code></pre>
  
  <p>You can see in the above that ST has got RANK 1 for value 643 as opposed to 1,2,3. Is this even possible?</p>
  
  <p>The code I have got is this one </p>
  
  <pre><code>rank = 
  RANKX(
      ALL(ADW_DEFECTS), ADW_DEFECTS[DAYS_OLD],
      ,,Dense
  )
  </code></pre>
  
  <p>But I am unable to add a filter for PRIO.</p>