Advance your Data & AI career with 50 days of live learning, dataviz contests, hands-on challenges, study groups & certifications and more!
Get registeredGet Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Learn more
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
Solved! Go to 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
Hi @i820017
use a column for sorting your YearMonth column (see figure). [1] and [2] are slicers sorted ascending and descending.
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.
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:
Result:
and here is sample pbix file, please try it.
Regads,
Lin
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?
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
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....
...then I would add a new column with the following formula.
This gives me a new column that I would then use for the 'Sort by column' option
Which makes my matrix go from this:
To this:
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.
Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!
Check out the October 2025 Power BI update to learn about new features.