Forum Discussion

jordanwhite16's avatar
jordanwhite16
Regular Visitor
1 year ago
Solved

RANK Dax issues!

Hi all,

 

I have the following dataset at my disposal and I'm looking at ranking the SumColumns shown in the dataset after a specific date of 2024, 9, 8 but as you can see there are duplicate values in the sum columns created (dax shown underneath) - and creating this rank measure would also mean dates before 2024, 8, 9 would need to be excluded. I included my current solution underneath these photos that duplicates the table, however I would want to avoid this and just write a new Dax with a new date in when the time comes to change ranges.

 

Duplication solution:

 

Thanks for your help in advance!

 

Jordan

  • Anonymous's avatar
    Anonymous
    1 year ago

    Hi jordanwhite16 

     

    Since I don't know what your data looks like, please try creating a measure to calculate the rank using the following DAX to see if that helps.

    RankAfterDate = 
    VAR SpecificDate = DATE(2024, 8, 9)
    RETURN
    RANKX(
        FILTER(
            ALL('YourTable'),
            'YourTable'[DateColumn] > SpecificDate
        ),
        CALCULATE(SUM('YourTable'[SumColumn])),
        ,
        DESC,
        DENSE
    )

    If it doesn't work, please provide some sample data, and remember to protect your data privacy in the sample data.

     

     

    Best Regards,
    Jarvis Tang
    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

3 Replies