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

Compete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.

Reply
S184019
Advocate III
Advocate III

Manually reorder rearrange matrix columns

I have a matrix that has the following columns Department ID, Department Name, Month, Numerator, and Denominator.  The month is in a format that isn't recognized by PBI as a date.  Specifically mine are in a MMM-YY format like, "Jan-18" or "Feb-18" (without the quotes) and so on.  I create a calc of Numerator/Denominator before I create the matrix.  'Month' are the columns and 'Department Name' becomes the rows. Month in this case becomes alphabetized and that is highly undesirable.  How do I go about manually rearranging or reordering the columns so that they aren't alphabetical such as "Apr-18", "Aug-17" and so on?  Matrix columns need to be oriented in an Aug-17, Sep-17, Oct-17, Nov-17, Jul-17... type of fashion

 

On a separate matter, How do I get the 'Department ID' as well as the 'Department Name' to show at the front of the matrix? 

 

Thanks in advance!

 

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @S184019,

 

Maybe you can try to use sort by column feature to manually setting sort order.
Reference links:

Sort by column in Power BI Desktop

Custom Sorting in Power BI

 

Regards,

Xiaoxin Sheng

View solution in original post

2 REPLIES 2
Anonymous
Not applicable

Hi @S184019,

 

Maybe you can try to use sort by column feature to manually setting sort order.
Reference links:

Sort by column in Power BI Desktop

Custom Sorting in Power BI

 

Regards,

Xiaoxin Sheng

The work around I have been using was what is alluded to in your post.  So thank you for that.   The motif of the support forums seems to be workarounds, which is okay, but not desirable.  Here is how I solved it....

 

Step 1) Create an additional column that is associated to the month. So for the row with a Jan-17, I created a column called SortIndex that had a 1.  Feb-17 a 2 and so forth. Notably I did this in SQL by creating a case when

Step 2) After loaded into PBI, I created a DAX column (not measure) called Month = Format('Mytable'[SQLMonth],"MMM-YY"). This is now a calculated column which can be sorted. 

Step 3) I used that calculated column as my column headers and then because it is calculated, I sorted it by the SortIndex field.  

 

Hope this helps those wondering how to rearrange, reorder, or arrange matrix columns until a drag and drop method can be implement! 

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

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

August 2025 community update carousel

Fabric Community Update - August 2025

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