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

Power BI is turning 10! Let’s celebrate together with dataviz contests, interactive sessions, and giveaways. Register now.

Reply
bebeto
Helper III
Helper III

Formatting a matrix

Hello,

 

I need to reply this Google Analytics in Power BI. I don't know how to show columns in groups like ('Adquisición', 'Comportamiento', etc). How can I do it in Power BI?

 

GA Matrix:

1.jpg

 

My Power BI Matrix, I need to group the 4 columns in one group called 'Adquisición':

1.jpg

 

1 ACCEPTED SOLUTION
v-haibl-msft
Microsoft Employee
Microsoft Employee

@bebeto

 

If we have a Table1 like below, we can select the last 4 columns and click “Unpivot Columns” in Query Editor.

Formatting a matrix_1.jpg

 

Then duplicate Table1 and remove columns of Paris and Value. Remove duplicates for the Attribute column in Table2.

Add a conditional column like below.

Formatting a matrix_2.jpgFormatting a matrix_3.jpg

 

Close and apply Query Editor. Create relationship between Table1 and Table2 with Attribute key. Drag table columns into Matrix as below.

Formatting a matrix_4.jpg

 

Best Regards,

Herbert

View solution in original post

5 REPLIES 5
v-haibl-msft
Microsoft Employee
Microsoft Employee

@bebeto

 

If we have a Table1 like below, we can select the last 4 columns and click “Unpivot Columns” in Query Editor.

Formatting a matrix_1.jpg

 

Then duplicate Table1 and remove columns of Paris and Value. Remove duplicates for the Attribute column in Table2.

Add a conditional column like below.

Formatting a matrix_2.jpgFormatting a matrix_3.jpg

 

Close and apply Query Editor. Create relationship between Table1 and Table2 with Attribute key. Drag table columns into Matrix as below.

Formatting a matrix_4.jpg

 

Best Regards,

Herbert

 

The problem is that my origin data is something like this:

 

1.jpg

 

 When I Unpivot the data as you said, maintaining the dimensions and unpivoting the measures, I get:

 

1.jpg

 

I create the other table as you said, with a column Attribute, I do the relationship between them, but in the matrix the values og the measures don't split:

 

1.jpg

 

And the matrix:

1.jpg

@bebeto

 

Could you please describe more about “the values og the measures don't split”? What is the expected result of them?

 

Best Regards,

Herbert

I didn´t remember the problem, but it is solved now, thanks!

ankitpatira
Community Champion
Community Champion

@bebeto In power bi you first need to have a column containing values like 'Adquisición' and others. You can get them through few ways either by going to power bi desktop query editor or using DAX create calculated column which will be like =IF (tableName[columnName] = "abc", 'Adquisición', "something else"). Once you have that column just drop it in the Column section for the matrix visual.

Helpful resources

Announcements
June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

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

June 2025 community update carousel

Fabric Community Update - June 2025

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