Starting December 3, join live sessions with database experts and the Microsoft product team to learn just how easy it is to get started
Learn moreGet certified in Microsoft Fabric—for free! For a limited time, get a free DP-600 exam voucher to use by the end of 2024. Register now
Hi all,
I have created a Matrix visual which has the datepart Year as column.
The year is sorted asc. It is possible to sort it desc?
Thanks.
Solved! Go to Solution.
Hi @Sebastian,
Based on my test, you should be able to follow steps below to sort Year column desc on Matrix visual.
1. Add a Year column to your table if you don't have it yet.
2. Use the formula below to create a new table, and create a relationship between the new table and your table with the Year column.
Table = SUMMARIZE ( Table1, Table1[Year], "Reverse Year", - MAX ( Table1[Year] ) )
3. Sort "Year" column by "Reverse Year" column in the new created table.
4. Then you should be able to show the Year column from the new created table as Column in the Matrix to Order Yer desc.
Here is the sample pbix file for your reference.
Regards
Hi @Sebastian,
Based on my test, you should be able to follow steps below to sort Year column desc on Matrix visual.
1. Add a Year column to your table if you don't have it yet.
2. Use the formula below to create a new table, and create a relationship between the new table and your table with the Year column.
Table = SUMMARIZE ( Table1, Table1[Year], "Reverse Year", - MAX ( Table1[Year] ) )
3. Sort "Year" column by "Reverse Year" column in the new created table.
4. Then you should be able to show the Year column from the new created table as Column in the Matrix to Order Yer desc.
Here is the sample pbix file for your reference.
Regards
Hi @Sebastian,
Here is a similar thread in which a workaround is mentioned. Could you go to check if it helps in your scenario?
You cannot achieve this reverse sorting directly... here is a workaround:
1. Go to the Edit Query option of the Week dim table.
2. Apply Sort desc on the unique week code column (there must be a unique identifier for each week i.e. in my case I have WeekCode column as 20170101, 20170102, 20170103, 20170104, 20170205, 20170206.... YYYYMMWW where WW is the incremental week number of the year from 1 to 52.
3. Select 'Add Index column' from Add Column menu and provide Starting Index=1 and Increment=1 in the dialog box.
4. Rename column as appropriate.
4. Save Apply and Close the Edit Query
5. Use this Index as 'Sort By Column' wherever required.
Regards
Click the header of the column you will see an Arrow appear on the bottom left. Double clik on the header to change your sort order
Starting December 3, join live sessions with database experts and the Fabric product team to learn just how easy it is to get started.
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Early Bird pricing ends December 9th.
User | Count |
---|---|
92 | |
87 | |
84 | |
65 | |
49 |
User | Count |
---|---|
140 | |
114 | |
110 | |
59 | |
59 |