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

Learn from the best! Meet the four finalists headed to the FINALS of the Power BI Dataviz World Championships! Register now

Reply
shaileng
Frequent Visitor

Dynamically Change Column Title

Hi,

 

Just wondering on how to achive the following.

 

I have a table which provides the dates to the slicer.

 

Now for each date I have huge data in data base and the column in which I am showing the data is named as "CurrentYear" instead all I want is to use the Year depending on the slicer date so for eg. the slicer says 1-Jan-2018 then the column title should say "Year 2018" and likewise. 

 

Thanks

2 REPLIES 2
Greg_Deckler
Community Champion
Community Champion

Another technique for this, depending on your specific scenario, which I am not 100% clear on, would be to create a Measure like:

 

My Year = "Year " & YEAR(MAX([Date]))

 Then you can display this using a Card visualization. With a little formatting, you can often overlay this or use this as a replacement for column titles, etc.



Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
DAX For Humans

DAX is easy, CALCULATE makes DAX hard...
itayrom
Resolver II
Resolver II

As far as I know, it is not possible to dynamically change a column's title.

 

I can, however, think of a way you can create an illusion as if that's whats happening, at least in some scenarios-

 

1. Add to your data table or date master table a new column, whose values would be in the form if 'Year <YearNumber>', where <YearNumber> is, obviously, the year part of the date column in the current row.

For example, add a calcuated column called 'RelevantYear' to your date master table with the following DAX expression-

RelevantYear = "Year " & YEAR([Date])

2. Add a matrix visual to your report, put all the categorical data you want to display in its 'Rows' field bucket, put the 'RelevantYear' column in its 'Columns' field bucket, and put the 'CurrentYear' column in its 'Values' field bucket.

 

This will result in 'Year <YearNumber>' columns in the matrix for each year in your data table, showing the data relevant for that year. When you select a date in your slicer, only the relevant 'Year <YearNumber>' for the selected date will be displayed.

 

3. Replace your slicer with a 'Chiclet Slicer' visual, which can be obtained from the custom visuals store, because it allows you to force a selection, basically making it function like a set of radio buttons, thus making only one 'Year <YearNumber>' column visible at any single moment. So add that chiclet slicer to your report, put the dates column in its category bucket, go to the 'General' tab in its 'Format' panel, set 'Multiple selection; to 'Off' and 'Forced selection' to 'On'.

 

Hope this helps!

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.