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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
PBI-Enthusiast
Frequent Visitor

Grouping columns in Matrix

Hello everyone

Currently I have a Matrix which looks like this:

PBIEnthusiast_0-1664444684791.png

Now I'd like to group the current columns to achieve this output:

PBIEnthusiast_1-1664444771298.png

Is there an easy / best way to do this?

The current source table looks like this:

PBIEnthusiast_2-1664444857949.png

The only solution I've found to achieve my goal is to unpivot the original table:

PBIEnthusiast_3-1664444974895.png

And to configure the matrix like this:

PBIEnthusiast_0-1664445282135.png

But I don't want to modify the structure of the original table because this will impact all my other visuals.

Thank you in advance for any hints.

Best regards,
PBI-Enthusiast

1 ACCEPTED SOLUTION
Greg_Deckler
Super User
Super User

@PBI-Enthusiast Unpivoting you data is generally the right way to go 99.9% of the time. If you don't then you are likely stuck with using a custom matrix hierarchy which tends to get a little ugly. (3) The New Hotness (Custom Matrix Hierarchy) - Microsoft Power BI Community


@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
The Definitive Guide to Power Query (M)

DAX is easy, CALCULATE makes DAX hard...

View solution in original post

2 REPLIES 2
Greg_Deckler
Super User
Super User

@PBI-Enthusiast Unpivoting you data is generally the right way to go 99.9% of the time. If you don't then you are likely stuck with using a custom matrix hierarchy which tends to get a little ugly. (3) The New Hotness (Custom Matrix Hierarchy) - Microsoft Power BI Community


@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
The Definitive Guide to Power Query (M)

DAX is easy, CALCULATE makes DAX hard...

Hi @Greg_Deckler 

Thank you very much for your quick response.

Alright, when this is best practice, I will go this way.

Best regards,
PBI-Enthusiast

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

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

April Fabric Community Update

Fabric Community Update - April 2024

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