Forum Discussion

kasife's avatar
kasife
Icon for Helper V rankHelper V
2 years ago
Solved

sort by month and year

Guys, I have a Matrix where my columns always have the 3 selected months and I would like to place them in order of month and year. As you can see, the ordering should be: November (2023), December (...
  • Ritaf1983's avatar
    2 years ago

    Hi kasife 
    You can't sort months without years in chronological order.
    There is no way for the engine to know when January is from last year and when from the next.
    You should use some combination of year and month to make it work.

    For example :

    Which can be sorted by column with the logic:
    Date.ToText([Date],"yyyyMM") from PQ 

    Pbix with my example and calendar table with the needed columns is attached.

    More information about sorting by month and year is here :
    https://www.youtube.com/watch?v=kHK6bnaD8ig