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

A new Data Days event is coming soon! This time we’re going bigger than ever. Fabric, Power BI, SQL, AI and more. Don't miss out.

Reply
mikeydubs
New Member

Matrix Column option - Row before column?

What I'm trying to do feels like it should be simple, but I can't find any option of information.  I suppose there will be an option to completely reshape the underlying data, but obviously I'd like to click a checkbox if it were that simple.

 

Instead of presenting data like this with Group as a row, year as a column, and values1-3 as values:

 Year2022  2023 
GroupValue1Value2Value3Value1Value2Value3
G1102030405060
G2110120130140150160

 

I need:

 Value1 Value2 Value3 
Group - Year202220232022202320222023
G1104020503060
G2110140120150130160

Basically I want the row to be higher in the hierachy than the column so year over year comparison is simpler on each metric or value.  I feel like there's probably a simple option, but I'm not seeing it right now.

9 REPLIES 9
danextian
Super User
Super User

hI @mikeydubs 

Things needed:

  1. a disconnected table containing a column for the name of the measures
  2. a sort column if you want the column in number 1 to be sorted other than alphabeticallyjkawsvbnm,.12u
  3. a format string column if the measures are to be formatted differently (dollar value, transaction volume, percentage)
  4. a measure to return another measure based on the row value of the column in number 1.

The second viz in the screenshot below is the end result of numbers 1-4.

danextian_0-1735799755144.png

 

Please see attached sample pbix.





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.

Thanks!  This appears to be what I need.  I still have to play with it to try to adapt it to my needs to make sure.  I wan't sure I was being clear in my initial request, but I wasn't trying to change any formulas or redefine what it means to be a measure, I just wanted it to display the matrix as 1, 2, 1, 2, 1, 2, 1, 2 instead of the default 1 ,1, 1, 1, 2, 2, 2, 2.  That really seems like it could have been a built-in option, but I will experiment with this work-around.

I've got some of this working.  The dynamic values you called Rev or Transactions works.  Category works and I can even add additional rows for drill-down.  Measure works as the first item in Columns, but my version of Geo (year) just seems to vanish as if it's not respected somehow or linked incorrectly or not an option to have that multi-level column setup but clearly it is as shown in your demo file.  I'll keep working at it.

Hi @mikeydubs 

As what @lbendlin mentioned in one of his replies "You will need to materialize the measure names (in a reference table) and then use a separate measure to calculate the values." and that is what essentially the approach in the sample pbix does.  Without doing so, you can't move the measures to before the columns.





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.

Obligatory https://xkcd.com/1205/

 

 

That really seems like it could have been a built-in option,

 

No, it is going squarely against the desing philosophy of Power BI.  What you are doing is "fighting the API", trying to make Power BI do something it was not designed for.

 

If this is important to you please consider voting for an existing idea or raising a new one at https://ideas.fabric.microsoft.com

mikeydubs
New Member

Thanks.  I don't really want the measures as columns.  I just don't want the report users to have to scroll so far right to see and compare Value1 for 2022 to Value1 for 2023.  In my example here, I only used 3 values, but in my real data there's more like 15 metrics and a potential year over year comparison loses usefulness when they might not even fit on the same screen.   I just want the order or hierarchy to be row then column instead of the natural column then row hierarchy.  While it could literally be a checkbox option, I would understand that it's very possible that it's not an option and I may have to tackle this from the data perspective.

I don't really want the measures as columns.

Matter of fact that's exactly what you want to do.  Remember that implicit measures ("values")  are measures too.

lbendlin
Super User
Super User

What you are trying to do is use measures as columns. That won't work.  You will need to materialize the measure names (in a reference table)  and then use a separate measure to calculate the values.

 

Please provide sample data that fully covers your issue.
Please show the expected outcome based on the sample data you provided.

Helpful resources

Announcements
May Power BI Update Carousel

Power BI Monthly Update - May 2026

Check out the May 2026 Power BI update to learn about new features.

Fabric SQL PBI Data Days

Data Days 2026 coming soon!

Sign up to receive a private message when registration opens and key events begin.

New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.