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

Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM. Register now.

Reply
Raaghu
Regular Visitor

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.

 

Raaghu_0-1595866667885.png

 

Thanks,

Raaghu

 

1 ACCEPTED SOLUTION
v-zhenbw-msft
Community Support
Community Support

Hi @Raaghu ,

 

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

 

M1.jpg

 

M2.jpg

 

1. Create a table like this,

 

 

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

 

 

M3.jpg

 

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

 

M4.jpg

 

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]))))

 

 

M5.jpg

 

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.

View solution in original post

4 REPLIES 4
v-zhenbw-msft
Community Support
Community Support

Hi @Raaghu ,

 

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

 

M1.jpg

 

M2.jpg

 

1. Create a table like this,

 

 

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

 

 

M3.jpg

 

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

 

M4.jpg

 

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]))))

 

 

M5.jpg

 

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.

Hi,

 

Thanks for the response.

 

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

 

 

Thanks,

amitchandak
Super User
Super User

@Raaghu , refer

column header grouping
https://www.daxpatterns.com/dynamic-segmentation/
https://community.powerbi.com/t5/Desktop/Matrix-Display-Values-above-Columns/td-p/256905
https://community.powerbi.com/t5/Desktop/grouping-measure-results/td-p/456795

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube
az38
Community Champion
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


do not hesitate to give a kudo to useful posts and mark solutions as solution
LinkedIn

Helpful resources

Announcements
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

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

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.