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

Don't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.

Reply
rpinxt
Power Participant
Power Participant

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
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

Jan25PBI_Carousel

Power BI Monthly Update - January 2025

Check out the January 2025 Power BI update to learn about new features in Reporting, Modeling, and Data Connectivity.

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.