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

Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started

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
July 2024 Power BI Update

Power BI Monthly Update - July 2024

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

PBI_Carousel_NL_June

Fabric Community Update - June 2024

Get the latest Fabric updates from Build 2024, key Skills Challenge voucher deadlines, top blogs, forum posts, and product ideas.

Top Solution Authors