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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
SIMM
New Member

How to switch columns order in a matrix table similar to pivot table fields

Hello,

 

I have created a Matrix table with cagegories in the rows and years in columns with values of 2 different mertics (Sales Dollars & Sales Pieces).  In the columns it is currently displaying 2024 Pieces then Dollars followed by 2025 Pieces then dollars, what I am trying to do is switch the order to display 2024 pieces then 2025 pieces followed by 2024 dollars then 2025 dollars which is basic to do in Excel with moving about the pivot table fields values but can't seem to work out how to do in PBI and can't find info in Google search

 

This is how data is currently represented and you can visulised what I want Year Year pieces then Year Year Dollars

SIMM_0-1751587045301.png

 

Thanks

 

 

 

6 REPLIES 6
v-veshwara-msft
Community Support
Community Support

Hi @SIMM ,
Just wanted to check if the response provided was helpful. If further assistance is needed, please reach out.
Thank you.

v-veshwara-msft
Community Support
Community Support

Hi @SIMM ,
Thanks for reaching out to Microsoft Fabric Community.

To switch columns order in Matrix visual the methods shared by @MasonMA and @danextian are valid and effective.

Just checking in to see if you had a chance to further review the solutions shared and whether they were helpful.

If further assistance is needed, please reach out.

Thank you.

danextian
Super User
Super User

Hi @SIMM 

 

You can reorder a column using a custom sort, but values and measures in a Power BI matrix follow a strict hierarchy — with dimensions first, followed by the measures. The sequence of measures (e.g., Pieces or Dollars) depends on their order in the Values tile. Unlike in Excel PivotTables, Power BI does not allow moving values above other hierarchy levels - egs placing Pieces and Dollars before the year. The workaround is to use a disconnected table containing a column of measure names and reference that column to return the value of each measure - sort of materializing them in a column.

danextian_0-1751610514309.png

Revenue or Volume = 
SWITCH (
    SELECTEDVALUE ( RevVolume[RevVolume] ),
    "Revenue", [Total Revenue],
    "Volume", [Total Transactions]
)

danextian_1-1751610551099.png

Please refer to the attached file and the links below

Create dynamic format strings for measures 

Sort one column by another column in Power BI 

 





Dane Belarmino | Microsoft MVP | Proud to be a Super User!

Did I answer your question? Mark my post as a solution!


"Tell me and I’ll forget; show me and I may remember; involve me and I’ll understand."
Need Power BI consultation, get in touch with me on LinkedIn or hire me on UpWork.
Learn with me on YouTube @DAXJutsu or follow my page on Facebook @DAXJutsuPBI.
SIMM
New Member

hello, thanks for the note and excample, unfortunately it would not let me move the MetricYear to column

MasonMA
Impactful Individual
Impactful Individual

@SIMM 

Sorry, there was a bit of confusion last night.

In your scenario, you may need to first pivot out the 'Metric' column by creating one calculated column. I don't think it would have to be in a disconnected table unless you wanted to sort by 'Sales Piece' and 'Sales Dollar' and have a dollar sign on amount (as in my sample data)

MasonMA_0-1751636556251.png

In Matrix table place the 'Metric' above 'Year' Column to have 'Metric' shown on the first level of Column header, like below. 

MasonMA_1-1751636736395.png

Thanks

 

MasonMA
Impactful Individual
Impactful Individual

@SIMM 

Hi, true it's not as intuitive as Excel. below is one of some other ways you can try. (I used some sample data and you can access this file here)

1. Create one Calculated column in the table

MetricYear =
'Table'[Metric] & " - " & FORMAT('Table'[Year], "0000")

 2. Create another Calculated column for sorting.

MetricSort =
SWITCH (
    TRUE(),
    'Table'[Metric] = "Sales Pieces" && 'Table'[Year] = 2024, 1,
    'Table'[Metric] = "Sales Pieces" && 'Table'[Year] = 2025, 2,
    'Table'[Metric] = "Sales Dollars" && 'Table'[Year] = 2024, 3,
    'Table'[Metric] = "Sales Dollars" && 'Table'[Year] = 2025, 4,
    99
)

then in the Model view select this MetricYear Column and sort by MetricSort

 

From there you can build your Matrix Visual like below

MasonMA_0-1751589257460.png

 

Helpful resources

Announcements
July 2025 community update carousel

Fabric Community Update - July 2025

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

July PBI25 Carousel

Power BI Monthly Update - July 2025

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

Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.