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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
amirabedhiafi
Impactful Individual
Impactful Individual

Change the column name of a matrix depending on a filter selection

I have the following matrix (I simplified it) :

 

y7gK6.png

I want when I select the months for the 2020 year, the name of the column Year becomes Year 2020
so that column is dynamically modified depending on the year selection.

and the next column will be Year N-1 which is Year 2019.
How can I achieve that ?



Amira Bedhiafi
Full Stack Business Intelligence Consultant @Capgemini
1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @amirabedhiafi ,

 

Such an output is not available. I'd suggest you put Year to Row field in matrix visual instead.

 

1. Add a Year column to your table.

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

2.Create a Calendat table for slicer.

Calendar = CALENDAR(MIN('Table'[Date]),MAX('Table'[Date])) 

3.Apply below measure to filter pane, set as "is 1":

Measure = 
var _selectYear=SELECTEDVALUE('Calendar'[Date].[Year])
return IF(YEAR(MAX('Table'[Date]))=_selectYear || YEAR(MAX('Table'[Date]))=_selectYear-1 ,1,0)

4.Drag [Cate] to Column field, [Year] to Row field:

 

Eyelyn9_0-1634884024254.png

 

Best Regards,
Eyelyn Qin
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
Anonymous
Not applicable

Hi @amirabedhiafi ,

 

Such an output is not available. I'd suggest you put Year to Row field in matrix visual instead.

 

1. Add a Year column to your table.

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

2.Create a Calendat table for slicer.

Calendar = CALENDAR(MIN('Table'[Date]),MAX('Table'[Date])) 

3.Apply below measure to filter pane, set as "is 1":

Measure = 
var _selectYear=SELECTEDVALUE('Calendar'[Date].[Year])
return IF(YEAR(MAX('Table'[Date]))=_selectYear || YEAR(MAX('Table'[Date]))=_selectYear-1 ,1,0)

4.Drag [Cate] to Column field, [Year] to Row field:

 

Eyelyn9_0-1634884024254.png

 

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

 

Greg_Deckler
Community Champion
Community Champion

@amirabedhiafi I am not aware of a way to make column headers dynamic like that unless you perhaps overlayed them with card visualizations that you used measures in.



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

Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

Check out the November 2025 Power BI update to learn about new features.

Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

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.

Top Solution Authors