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
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
v-kongfanf-msft
Community Support
Community Support

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
Community Champion
Community Champion

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
Community Champion
Community Champion

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
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!

December 2024

A Year in Review - December 2024

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