Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
3 years ago
Solved

RANKX

After trying the full day, I'm hopeless to find the answer, how to rank for one NAME and DATE over the BATCH   batch (number) date (date) name (text) rank 10 1/1/2022 abc 1 22 1/...
  • Shaurya's avatar
    3 years ago

    Hi Anonymous,

     

    Since you want to rank the Batch column for a particular Name and Date, you'll have to consider all the other records in the Name and Date column with that value. Therefore, you'll have to use the EARLIER() function along with RANKX() and FILTER().

     

    Use this DAX Formula:

     

    Rank = RANKX(FILTER('Table','Table'[Date]=EARLIER('Table'[Date])&&'Table'[Name]=EARLIER('Table'[Name])),'Table'[Batch],,ASC,DENSE)

     

    Here's the result:

     

     

     

    Works for you? Mark this post as a solution if it does!