Forum Discussion

bebeto's avatar
bebeto
Helper III
9 years ago
Solved

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:

 

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

 

  • bebeto

     

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

     

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

    Add a conditional column like below.

     

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

     

    Best Regards,

    Herbert

5 Replies

  • ankitpatira's avatar
    ankitpatira
    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.

  • v-haibl-msft's avatar
    v-haibl-msft
    Microsoft Employee

    bebeto

     

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

     

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

    Add a conditional column like below.

     

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

     

    Best Regards,

    Herbert

    • bebeto's avatar
      bebeto
      Helper III

       

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

       

       

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

       

       

      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:

       

       

      And the matrix:

      • v-haibl-msft's avatar
        v-haibl-msft
        Microsoft Employee

        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