Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
5 years ago
Solved

DAX - Ranking Column by multiple text columns and date/time

Hi all,

I would need some help with a column ranking names in a table. 
The problem is that the customers can change the ResourceName but the ResourceID will stay the same.
I need to rank the ResourceName-s, grouped by the ResourceID-s, and the freshest/newest to have the Rank number 1 for every ResourceID group.
Any help would be much appreciated.
See the example data and an added expected Rank result column in it.

 

 

 

 

 

 

 

 

ExampleFileCanBeDownloadedHere 

Many thanks,
Roland

4 Replies

    • Anonymous's avatar
      Anonymous
      Not applicable

      Thank you Jihwan_Kim ,
      This looks like exactly what I was looking for. I guess the Max Starttime is not someting difficult. I will try this tomorrow at work!

      Kind Regards,
      Roland

  • Anonymous , A new column like

    rank = rankx(filter(Table, [resource id] = earlier([resource id])), [resourceName],,desc,dense)

     

    But I doubt you will get same order

    • Anonymous's avatar
      Anonymous
      Not applicable

      Thanks amitchandak ,
      Yes, the problem is that I need it to be in order by the starttime. :S
      As it can be changed the same day and I need the freshest to be the number 1.
      I was thinking somehow to get the MAX of the ID row involved in the formula as that is an autoincrement, so the same day the highest ID for every ResourceID to be the number 1 rank... That might rank it the same way I need.