Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started

Reply
Sebastian
Advocate II
Advocate II

Matrix visual sorting column

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.

 

 

1 ACCEPTED SOLUTION
v-ljerr-msft
Employee
Employee

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] ) )

t1.PNGrs1.PNG

 

3. Sort "Year" column by "Reverse Year" column in the new created table.

 

sort1.PNG

 

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.

 

r1.PNG

 

Here is the sample pbix file for your reference. Smiley Happy

 

Regards

View solution in original post

5 REPLIES 5
v-ljerr-msft
Employee
Employee

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] ) )

t1.PNGrs1.PNG

 

3. Sort "Year" column by "Reverse Year" column in the new created table.

 

sort1.PNG

 

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.

 

r1.PNG

 

Here is the sample pbix file for your reference. Smiley Happy

 

Regards

Hi @v-ljerr-msft

 

That works really fine. Thank you very much 🙂

v-ljerr-msft
Employee
Employee

Hi @Sebastian,

 

Here is a similar thread in which a workaround is mentioned. Could you go to check if it helps in your scenario? Smiley Happy

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

Hi @v-ljerr-msft

 

thanks for your answer.I tried this way but the sorting is still the same.

sgsukumaran
Resolver II
Resolver II

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

Helpful resources

Announcements
Fabcon_Europe_Social_Bogo

Europe’s largest Microsoft Fabric Community Conference

Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.

Power BI Carousel June 2024

Power BI Monthly Update - June 2024

Check out the June 2024 Power BI update to learn about new features.

PBI_Carousel_NL_June

Fabric Community Update - June 2024

Get the latest Fabric updates from Build 2024, key Skills Challenge voucher deadlines, top blogs, forum posts, and product ideas.

RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.

Top Solution Authors