Forum Discussion

Raaghu's avatar
Raaghu
Regular Visitor
6 years ago
Solved

Matrix column header/label custom group

Hello,

 

I want to group the columns in Matrix Visual as Group A , Group B and Group C as shown below.

A, A1,B, B1, C, C1 are the measures created, so now want to have the label as shown below group A, B and C which are not the database values.

 

 

Thanks,

Raaghu

 

  • Hi Raaghu ,

     

    We create a sample, we can create a new table and two measures to meet your requirement.

     

     

     

    1. Create a table like this,

     

     

    Table (2) = CROSSJOIN(VALUES('Table'[Type]),{"Group A","Group B","Group C"})

     

     

     

    2. Then we can create a matrix table using this table.

     

     

    3. At last we can create two measures and add them to Values.

     

     

    Measure = 
    SWITCH(
        TRUE(),
        MAX('Table (2)'[Group])="Group A",CALCULATE([Measure A],FILTER('Table','Table'[Type]=MAX('Table (2)'[Type]))),
        MAX('Table (2)'[Group])="Group B",CALCULATE([Measure B],FILTER('Table','Table'[Type]=MAX('Table (2)'[Type]))),
        MAX('Table (2)'[Group])="Group C",CALCULATE([Measure C],FILTER('Table','Table'[Type]=MAX('Table (2)'[Type]))))

     

     

     

    Measure 2 = 
    SWITCH(
        TRUE(),
        MAX('Table (2)'[Group])="Group A",CALCULATE([Measure A1],FILTER('Table','Table'[Type]=MAX('Table (2)'[Type]))),
        MAX('Table (2)'[Group])="Group B",CALCULATE([Measure B1],FILTER('Table','Table'[Type]=MAX('Table (2)'[Type]))),
        MAX('Table (2)'[Group])="Group C",CALCULATE([Measure C1],FILTER('Table','Table'[Type]=MAX('Table (2)'[Type]))))

     

     

     

    If it doesn’t meet your requirement, could you please provide a mockup sample based on fake data and describe the measures?

     

    It will be helpful if you can show us the exact expected result based on the tables.

    Please upload your files to OneDrive For Business and share the link here. Please don't contain any Confidential Information or Real data in your reply.

     

    Best regards,

     

    Community Support Team _ zhenbw

    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

     

    BTW, pbix as attached.

5 Replies

  • az38's avatar
    az38
    Community Champion

    Hi Raaghu 

    Create a column like

    Group column = "Group " & LEFT(Table[Group], 1)

    and put this column into matrix visual as Column above the origin group field

  • v-zhenbw-msft's avatar
    v-zhenbw-msft
    Community Support

    Hi Raaghu ,

     

    We create a sample, we can create a new table and two measures to meet your requirement.

     

     

     

    1. Create a table like this,

     

     

    Table (2) = CROSSJOIN(VALUES('Table'[Type]),{"Group A","Group B","Group C"})

     

     

     

    2. Then we can create a matrix table using this table.

     

     

    3. At last we can create two measures and add them to Values.

     

     

    Measure = 
    SWITCH(
        TRUE(),
        MAX('Table (2)'[Group])="Group A",CALCULATE([Measure A],FILTER('Table','Table'[Type]=MAX('Table (2)'[Type]))),
        MAX('Table (2)'[Group])="Group B",CALCULATE([Measure B],FILTER('Table','Table'[Type]=MAX('Table (2)'[Type]))),
        MAX('Table (2)'[Group])="Group C",CALCULATE([Measure C],FILTER('Table','Table'[Type]=MAX('Table (2)'[Type]))))

     

     

     

    Measure 2 = 
    SWITCH(
        TRUE(),
        MAX('Table (2)'[Group])="Group A",CALCULATE([Measure A1],FILTER('Table','Table'[Type]=MAX('Table (2)'[Type]))),
        MAX('Table (2)'[Group])="Group B",CALCULATE([Measure B1],FILTER('Table','Table'[Type]=MAX('Table (2)'[Type]))),
        MAX('Table (2)'[Group])="Group C",CALCULATE([Measure C1],FILTER('Table','Table'[Type]=MAX('Table (2)'[Type]))))

     

     

     

    If it doesn’t meet your requirement, could you please provide a mockup sample based on fake data and describe the measures?

     

    It will be helpful if you can show us the exact expected result based on the tables.

    Please upload your files to OneDrive For Business and share the link here. Please don't contain any Confidential Information or Real data in your reply.

     

    Best regards,

     

    Community Support Team _ zhenbw

    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

     

    BTW, pbix as attached.

    • Raaghu's avatar
      Raaghu
      Regular Visitor

      Hi,

       

      Thanks for the response.

       

      In my case I cannot build the relationship as you did like "Type" column.

       

       

      Thanks,

    • WalterPowerBi's avatar
      WalterPowerBi
      Regular Visitor

      Dear Sirs

       

      I tried to recreate your solution, but it somehow does not work...
      Instead of "Budget" I see the name of the measure....

      what Im doing wrong?

       

      thanks

       

      Regards

       

      Walter