Forum Discussion

Companyuser101's avatar
3 years ago
Solved

Rangx for date

Hello,

I have this table:

 

I want to create a rank for the data with the "Bestelldatum" which is the order date.

 

Earliest should be 1 and then counting...

 

Somehow it does not work with date columns, how can I do it`?

 

Thanks!

 

 

  • I tried a little bit with the rankx measure and solved my problem with this measure: 

    Rank within Group = RANKX(ALLSELECTED(M7), M7[Bestelldatum], Min(M7[Bestelldatum]), ASC, Dense)
     
    But thank you for your input!
    It helped me to understand how rankx works 

     

8 Replies

  • mlsx4's avatar
    mlsx4
    Memorable Member

    Hi Companyuser101 

     

    Should work if you use:

     

    Rank= 
    RANKX(
    ALLSELECTED('Table'[Bestelldatum]),
    CALCULATE(MIN('Table'[Bestelldatum])),,ASC, Dense)
  • It's still not working:

     

    Rankx is including the blank values which I excluded in this table. 

     

    • mlsx4's avatar
      mlsx4
      Memorable Member

      It is really difficult to figure out what's happening without having the data... As you see, in my example was working because I took what you put it in the picture

  • I tried a little bit with the rankx measure and solved my problem with this measure: 

    Rank within Group = RANKX(ALLSELECTED(M7), M7[Bestelldatum], Min(M7[Bestelldatum]), ASC, Dense)
     
    But thank you for your input!
    It helped me to understand how rankx works