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

Vote for your favorite vizzies from the Power BI Dataviz World Championship submissions. Vote now!

Reply
rpinxt
Solution Sage
Solution Sage

Can Matrix column header get name of value selected in a switch?

Maybe a bit cryptic but maybe some picture will explain better.

So I have this matrix and a slicer:

rpinxt_0-1655379525848.png

You see the matrix has a column names LBE Selection and that works with the LBE chose in the slicer (in this case lbe2).

The LBE Selection works on a SWITCH formula :

LBE Selection =
SWITCH(
Metrics[Selected LBE],
1, [LBE1],
2, [LBE2],
3, [LBE3],
4, [LBE4],
5, [Plan]
)
 
All works like a charme just wondering if there is a way to make the colum header variable?
So instead of LBE Selection it would look nicer when its calles LBE2 and if I would choose LBE1,...LBE1 etc.
1 ACCEPTED SOLUTION
v-yanjiang-msft
Community Support
Community Support

Hi @rpinxt ,

I'm afraid you can't do it directly, here's my workaroud.

1.Create a card visual, and create a measure like below, put the measure in the visual.

Header = SELECTEDVALUE(LBE[LBE])

2.Put the card visual on top of the LBE Selection column header, get the result.

vkalyjmsft_0-1655712420826.png

Here're some related threads, you can see if it helps: 

Solved: Dynamic matrix visual column headers - Microsoft Power BI Community

Solved: Dynamic column header in Table or Matrix - Microsoft Power BI Community

 

I attach my sample below for reference.

 

Best Regards,
Community Support Team _ kalyj

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

View solution in original post

2 REPLIES 2
v-yanjiang-msft
Community Support
Community Support

Hi @rpinxt ,

I'm afraid you can't do it directly, here's my workaroud.

1.Create a card visual, and create a measure like below, put the measure in the visual.

Header = SELECTEDVALUE(LBE[LBE])

2.Put the card visual on top of the LBE Selection column header, get the result.

vkalyjmsft_0-1655712420826.png

Here're some related threads, you can see if it helps: 

Solved: Dynamic matrix visual column headers - Microsoft Power BI Community

Solved: Dynamic column header in Table or Matrix - Microsoft Power BI Community

 

I attach my sample below for reference.

 

Best Regards,
Community Support Team _ kalyj

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

Thanks @v-yanjiang-msft 

That could be indeed be a workaround.

 

Say how did you add that pbix file??

That would be really helpful to add sample books if you ask help from the community.

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

Vote for your favorite vizzies from the Power BI World Championship submissions!

Sticker Challenge 2026 Carousel

Join our Community Sticker Challenge 2026

If you love stickers, then you will definitely want to check out our Community Sticker Challenge!

January Power BI Update Carousel

Power BI Monthly Update - January 2026

Check out the January 2026 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.