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

Don't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.

Reply
LemondBI
New Member

Reorganizing Columns in Matrix

Hello, 

 

I am new to developing in Power BI and am trying to replicate, as best as i can, a previous report. The report shows Revenue by quarter for two differnent time periords, Previuous Year and Curreny Year. the report then shows dollar difference and % change by quarter. However, when I set this up in a matrix, the output looks like:

 Q1   Q2   Q3   Q4   
 PY RevCY Rev$ ▲% ▲PY RevCY Rev$ ▲% ▲PY RevCY Rev$ ▲% ▲PY RevCY Rev$ ▲% ▲
McDonalds                
Wendy's                

 

I want the report to be set up like this:

 Q1Q2Q3Q4Q1Q2Q3Q4Q1Q2Q3Q4Q1Q2Q3Q4
 PY RevPY RevPY RevPY RevCY RevCY RevCY RevCY Rev$ ▲ Q/Q$ ▲ Q/Q$ ▲ Q/Q$ ▲ Q/Q% ▲ Q/Q% ▲ Q/Q% ▲ Q/Q% ▲ Q/Q
McDonalds                
Wendy's                

 

Is there a way to reorder columns in Power BI, or does anyone have suggestions on how to present this report? Thanks!

 

1 REPLY 1
whitch
Resolver I
Resolver I

Use 'Enter data' to create a little 4-row 2-column table.  Call the table 'tblColumns':

Col_Name    Order

CY Rev         1

PY Rev         2

$ Q/Q          3

% Q/Q         4

Once created, click on [Col_Name] and a 'Column Tools' tab should appear in the ribbon.  Use 'Sort by column' to sort [Col_Name] by [Order]

Ensure this little table is NOT linked to anything in modelling view.

Create the following measure:

 

tableVales = if(SELECTEDVALUE(tblColumns[Col_Name]) = "CY Rev", [CY Rev],if(SELECTEDVALUE(tblColumns[Col_Name]) = "PY Rev", [PY Rev],if(SELECTEDVALUE(tblColumns[Col_Name]) = "$ Q/Q", [$ Q/Q],if(SELECTEDVALUE(tblColumns[Col_Name]) = "% Q/Q", [% Q/Q],0))))
 
I have assumed you already have [CY Rev], [PY Rev], [$ Q/Q], and [% Q/Q] measures from your previous work (or, if not, they can easily be made).
 
Create a matrix visual. [Business] goes in rows, [Col_Name] then [Quarter] in columns, [tableValues] in values.
 
I realise some things are confusingly named, but what else do I call a table which lists names of measures?

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Prices go up Feb. 11th.

Jan25PBI_Carousel

Power BI Monthly Update - January 2025

Check out the January 2025 Power BI update to learn about new features in Reporting, Modeling, and Data Connectivity.

Jan NL Carousel

Fabric Community Update - January 2025

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