Forum Discussion

CastroRibeiro's avatar
3 years ago
Solved

Descending Order when using date in a matrix

In a matrix, I need the numbers to be ordered from the highest to the lowest, that the current day is always the first from left to right. how can I do this? I'm using a calendar table relating to t...
  • Ritaf1983's avatar
    3 years ago

    Hi  CastroRibeiro 
    You can achieve it with 2 manipulations on your date table:
    1. Duplicate "Day" column:

    day_For_matrix = day('date'[Date])

    2. Add a column for Descending sorting:

    Rank_Order = RANKX(FILTER(ALL('date'), MONTH('date'[Day]) = MONTH('date'[Date])), 'date'[Day], , DESC, Dense)

    Sort your new day column by this ranking :

    Result:

    Link to the sample file 

    If this post helps, then please consider Accepting it as the solution to help the other members find it more quickly