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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
TLW_STL
Helper I
Helper I

How To Sort Matrix Columns When Using Calculated Column?

I created a matrix, using a calculated column.  The data displayed is correct, but I'd rather that my columns sort in the opposite direction. 

 

In the screen shot below, I show the calculated column.  Is there a way that I can change the calculation to sort data from left to right?  If not, should I create another column using INDEX?  Or maybe RANKX?  

 

I also have a link to a similar file saved to OneDrive, in case someone wants to review.

 

Thanks for any suggestions!

 

Screen shot 1.jpg

 

https://onedrive.live.com/?cid=7E43163E8AB99B59&id=7E43163E8AB99B59%21955&parId=7E43163E8AB99B59%211...

 

1 REPLY 1
vicky_
Super User
Super User

vicky__0-1692139334488.png

you will need to create a custom sort column for your months, and thn go to Column tools > Sort by Column > [your calculated column].

I used the following DAX in my calculated column:

month sort = RANKX('Table', 'Table'[Month], , DESC)

 

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

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.