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
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
Employee
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
Employee
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
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.