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

Next up in the FabCon + SQLCon recap series: The roadmap for Microsoft SQL and Maximizing Developer experiences in Fabric. All sessions are available on-demand after the live show. Register now

Reply
Vcaze
Frequent Visitor

Dynamic Column Headers in Power BI Matrix Based on Year Selection

Good afternoon,

I’m hoping someone can help me with this limitation in Power BI. I’m building a report that includes some Matrix visuals where I’ve placed a field parameter in the Rows and a few metrics in the Values. For simplicity, I’ll mention only three metrics: Current Year Sales, Previous Year Sales, and Sales Variation.

What I would like to achieve is dynamic column names that change based on the year selected in the slicer. For example, if the user selects 2024, the columns should be labeled as 'Sales 2024' and 'Sales 2023.' If 2023 is selected, they should show as 'Sales 2023' and 'Sales 2022.'

Is it possible to implement this dynamic naming of columns?

7 REPLIES 7
Anonymous
Not applicable

Hi @Vcaze ,

 

Currently for matrix visual, there is no support for dynamically changing column names, you can only refer to the alternative provided by @SamWiseOwl  @audreygerred  @Kedar_Pande .

 

Best Regards,
Adamk Kong

 

audreygerred
Super User
Super User

Hi! It is not possible for the headers to be dynamic like you are requesting. What I usually do when someone insists on having the actual date instead of undertstanding that This Year = whatever year you are filtered to and Last Year = the year before you are filtered to I add a legend to the page using a table or cards so that they have a visual reference as to what this year and last year are representing.





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!





Kedar_Pande
Super User
Super User

Dynamic Current Year Sales Name = 
"Sales " & SELECTEDVALUE(Year[Year])
Dynamic Previous Year Sales Name = 
"Sales " & (SELECTEDVALUE(Year[Year]) - 1)

Use a Card visual to show dynamic names created in the measures above and place it on the column header.

Direct column headers in the Matrix can't change dynamically, but using additional visuals can help simulate this effect.

If this helped, a Kudos 👍 or Solution mark would be great! 🎉
Cheers,
Kedar
Connect on LinkedIn

Thank you for your help. That solution works for Matrix with few columns, which is not my case.

Thank you for your time

SamWiseOwl
Super User
Super User

Hi @Vcaze 

 

I could be wrong but I don't believe so.

Instead you can insert a blank button: Insert | Buttons | Blank Button

 

Then set the Text equal to a measure:
Dynamic Button text = "Sales " & SelectedValue(table[year])

 

SamWiseOwl_0-1728916192412.png

 


If you are happy with this answer please mark as a solution for others to find !

Kudos are always appreciated! Check out our free Power BI video courses.

@Vcaze  You can make the visual title dynamic.

That way it reads 2024 above all of them.

SamWiseOwl_0-1728917323754.png

 


If you are happy with this answer please mark as a solution for others to find !

Kudos are always appreciated! Check out our free Power BI video courses.

Thank you for your answer. I know that the title can be dynamic, but I really need to dynamically change the column names.

Thank you.

Helpful resources

Announcements
New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.

Join our Fabric User Panel

Join our Fabric User Panel

Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.

March Power BI Update Carousel

Power BI Community Update - March 2026

Check out the March 2026 Power BI update to learn about new features.