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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
UncleLewis
Helper V
Helper V

Sort Matrix Columns Descending Order

Hi all,

 

How can I sort columns in descending order?
I tried moving the index to Rows, sorted descending and then moved back to columns but it reverted to Ascending order

Thanks,

-w

 

matrix sort.png

1 ACCEPTED SOLUTION
speedramps
Super User
Super User

Hi UncleLewis

 

I assume your 1,2,3,4,5 to 12 column headings are months

In the query editor add a column called revmonthsrt = [month] * -1

to create -1,-2,-3,-4,-5 to -12

then in modeller sort month by revmonthsrt 

 

your report will then dislay column headings decsending 12,11,10,9,8 etc

 

Please click thumbs up and accept as solution buttons. Thanks. 😀 

View solution in original post

3 REPLIES 3
speedramps
Super User
Super User

Sorry I meant to press save but hit accept solution by total accident whilst inputting this post, how rude 😮😮

but this solution should work....

 

Click here to download example 

 

I assume your 1,2,3,4,5 to 12 column headings are months

In the query editor add a column called revmonthsrt = [month] * -1

to create -1,-2,-3,-4,-5 to -12

then in modeller sort month by revmonthsrt 

check datatypes ar numbers

your report will then dislay column headings decsending 12,11,10,9,8 etc

 

Please click thumbs up and accept as solution buttons. Thanks

 

speedramps_1-1652199970283.png

 

 

speedramps_0-1652199900733.png

 

UncleLewis
Helper V
Helper V

Thanks @speedramps 

 

I tried the reverse item, didn't change the order on the visual. Tried Asc and Desc.


I tried to remove all columns and added index column from Date Table - Matrix columns are Asc

I went to Data View and sorted the Index Column Desc.
I went back to Report View. Matrix Columns are still in Asc order

What am I doing wrong?

Thanks,
-w

speedramps
Super User
Super User

Hi UncleLewis

 

I assume your 1,2,3,4,5 to 12 column headings are months

In the query editor add a column called revmonthsrt = [month] * -1

to create -1,-2,-3,-4,-5 to -12

then in modeller sort month by revmonthsrt 

 

your report will then dislay column headings decsending 12,11,10,9,8 etc

 

Please click thumbs up and accept as solution buttons. Thanks. 😀 

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

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

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.