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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Learn more

Reply
i820017
Resolver II
Resolver II

Descending Order

Hey Everybody,

I am trying to put the order of the columns in one of my reports in descending order by YearMonth in a matrix. Right now, it is in ascending order. I have tried using 'Sort by Column', but that only sorts the data in the table component of Power BI, not in the matrix in the UI. Does any one know how to fix this? It seems pretty basic, but it has me stumped 😁

 
 
 

The column titles are, in order, 20202, 20203, 202004, 202005, 202006, 202007, 202008, 202009, 202010.

I want the column titles to be reversed so that 2020010 comes first, then 202009, and so on.

 

Thanks

Dan

 

1 ACCEPTED SOLUTION

I just got it to work. I had to pull from a new table, join the table, and then it worked... thanks for your help

View solution in original post

7 REPLIES 7
FrankAT
Community Champion
Community Champion

Hi @i820017 

use a column for sorting your YearMonth column (see figure). [1] and [2] are slicers sorted ascending and descending.

 

30-09-_2020_23-09-58.png

 

With kind regards from the town where the legend of the 'Pied Piper of Hamelin' is at home
FrankAT (Proud to be a Datanaut)

It is still not working. This is what I am getting.

i820017_0-1602020963510.png

 

hi  @i820017 

For your case, you need to use sort by column to get it:

https://radacad.com/sort-by-column-in-power-bi

 

just create a column as as below:

DescYearMonth = -(YEAR('Date'[Date])*100+MONTH('Date'[Date]))

then set sort by column as below:

9.JPG

 

Result:

10.JPG

and here is sample pbix file, please try it.

 

Regads,

Lin

Community Support Team _ Lin
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Hey Lin,

It's still not working. This is a double-layered report as seen below. Do you think that the fact that the report is double-layered is causing the problem? Moreover, do you have another visualization like a matrix that I can download that will alleviate this issue?

i820017_0-1602172686636.png

Thanks

Than

I just got it to work. I had to pull from a new table, join the table, and then it worked... thanks for your help

Anonymous
Not applicable

At the moment Power BI doesn't have the capability to sort the column order of a matrix; only the row order may be sorted. 

A simple work around is to add a custom column in data view that reverses all the values and sort by that column. 

For example, if I'm currently using [MMM YYY] in my matrix and sorting it by serial month....

hunterfeldman_0-1601500059370.png

...then I would add a new column with the following formula.

hunterfeldman_1-1601500181349.png

This gives me a new column that I would then use for the 'Sort by column' option

hunterfeldman_2-1601500236237.png

Which makes my matrix go from this: 

hunterfeldman_0-1601500576538.png

To this: 

hunterfeldman_1-1601500615479.png

 



 

I switched the sign of the YearMonth column, then I sorted by that new column, and it still didn't work. I am getting this.

i820017_0-1602021153078.png

 

 

Helpful resources

Announcements
Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

Check out the October 2025 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors