Forum Discussion
Syndicate_Admin
Administrator
2 years agoSORT FOR A YEAR
Hi how are you, I want to sort my data by YEAR but I haven't managed to do it, I'm loading the data into an array and this is the detail of the array And so it shows me the data in the matri...
- 2 years ago
Thank you for your reply, I had already made a code which worked for me, I took it from another solution and used it as an example.
Create another tableYearOrder = DATATABLE("Year",INTEGER,"YearDesc",INTEGER,{{2021,2024},{2022,2023},{2023,2022},{2024,2021 }})
I related it to the base table where the year is, then in the matrix I showed the Year value of the new table, that way I sort the data by year.
Thank you very much and I leave the link from which I took the example, it was for months but the truth is that it also helped me to adjust it to the YEAR.
https://community.fabric.microsoft.com/t5/Translated-Spanish-Desktop/Ordenar-por-a%C3%B1o-y-mes-una-matriz/m-p/3011783#M528499
Kaviraj11
Solution Sage
2 years agoYou will need to create a column
SortYear = YEAR('CALENDAR'[DATE])*-1
Then, select the Year column used in Matrix and go to the 'column tools' from the menu bar and select the SortYear Column from 'Sort By Column' drop down.
This will gives you the expected result.