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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
mp390988
Helper V
Helper V

How to make the headers in a matrix visual dynamic

Hi,

 

In the image below, I want those headers I have marked to be dynamic.

Specifically, 

RevenueForPrevYear should just display "2024"

RevenueForCurrYear should just display "2025"
RevenueDiff should just display "2025 vs 2024"
RevenueDiff% should just display "%"

 

mp390988_0-1753697682243.png

 

I have a calendar table as per below:

mp390988_1-1753697910180.png

 

Can someone please help me?

 

Thank You

 

8 REPLIES 8
v-pnaroju-msft
Community Support
Community Support

Thankyou @mh2587 , @rohit1991 , @jaineshp  for your responses.

Hi mp390988,

We appreciate your inquiry through the Microsoft Fabric Community Forum.

We would like to inquire whether have you got the chance to check the solutions provided by @mh2587@rohit1991 , @jaineshp  to resolve the issue. We hope the information provided helps to clear the query.

Should you have any further queries, kindly feel free to contact the Microsoft Fabric community.
Thank you.

rohit1991
Super User
Super User

Hi @mp390988 ,

 

Here’s what works in real projects: 

 

Dynamic Titles Above Matrix (Best Practice) Create DAX measures for the year labels (e.g., CurrentYearTitle = MAX(Calendar[Year]), PrevYearTitle = MAX(Calendar[Year])-1, DiffTitle = PrevYearTitle & " vs " & CurrentYearTitle, etc.) Use Card or Text Box visuals above your matrix columns and bind them to these measures. Turn off matrix column headers (formatting pane), align the cards above the right columns for a clean look.

This way, whenever your year or data context changes, the titles update automatically no manual editing every year.

 

Disconnected Table + SWITCH (Advanced, but not 100% dynamic) You can use a disconnected table with static header names and a SWITCH statement in a measure, but as you noticed, you’d still need to update the table for each new year. Not truly dynamic, so I avoid this for rolling reports.

 

Calculation Groups (Advanced, with Tabular Editor) If you have Analysis Services, AAS, or a Premium workspace, you can use Calculation Groups in Tabular Editor to generate dynamic column headers. This takes more setup but is the only way to do this at the model level. For most Power BI Desktop users, option 1 above is quickest and most reliable.

 


Did it work? ✔ Give a Kudo • Mark as Solution – help others too!

Hi @rohit1991 ,

 

Can I please check is there an option to turn off headers for matrix visuals or do you mean make the font white to make them look like they are not there?

 

Thanks

Hi @mp390988 ,


There’s no direct toggle in Power BI to completely remove matrix column headers, the Matrix visual always keeps those for accessibility reasons.

Here’s what works best in reports:

 

  • In the Format pane under Column headers, set the font color to match your background (usually white if your background is white). This makes the headers appear “invisible” to viewers, even though they’re technically still there.

  • You can also set the font size to the minimum or turn off outlines for an even cleaner look.

  • Then, use Card or Text Box visuals above your matrix columns to display your dynamic year labels (from your DAX measures). This gives you total control over the titles and keeps things looking sharp and dynamic each year.

If you’re working with Calculation Groups via Tabular Editor (for Premium/SSAS users), you can dynamically change the headers themselves but for most users, the color trick + card visuals is the quickest and cleanest solution.

 


Did it work? ✔ Give a Kudo • Mark as Solution – help others too!
jaineshp
Helper V
Helper V

Hi @mp390988 ,

Here’s a step-by-step approach that works reliably and keeps your table clean and dynamic:

Option 1: Use Measure Titles (Overlay on Top of Table or Matrix)

You can use cards or text boxes to display dynamic titles above your columns. Create measures like this:

SelectedYear = MAX('Calendar'[Year])

PreviousYearTitle = SELECTEDVALUE('Calendar'[Year]) - 1
CurrentYearTitle = SELECTEDVALUE('Calendar'[Year])
DiffTitle = SELECTEDVALUE('Calendar'[Year]) & " vs " & (SELECTEDVALUE('Calendar'[Year]) - 1)

Then use these in card visuals or text boxes placed just above each column in your report. You can turn off column headers in the matrix visual and use these dynamic titles for a seamless look.


Option 2: Create a Disconnected Table + SWITCH Measure for Matrix (Advanced)

Create a disconnected table with column labels and use a SWITCH statement to return the appropriate measure:

 

Step 1: Disconnected Table

HeaderNames = DATATABLE("Label", STRING, {
{"2024"},
{"2025"},
{"2025 vs 2024"},
{"%"}
})

Step 2: Dynamic Measure

SelectedLabelMeasure =
SWITCH(
SELECTEDVALUE(HeaderNames[Label]),
"2024", [RevenueForPrevYear],
"2025", [RevenueForCurrYear],
"2025 vs 2024", [RevenueDiff],
"%", [RevenueDiff%]
)

Use this dynamic measure in a matrix visual with HeaderNames[Label] as the column and your Dealer fields as rows.

I'm confident this solution will meet your needs and enhance your report presentation.
If this helps, please consider giving it a kudos and marking it as the accepted solution. 👍

 

Hi @jaineshp ,

 

Thank you for your suggested solution, I tried adopting option 2 but this is not dynamic at all. How will this help when we move onto 2026? Someone will still need to go into the DAX formulas and update the years i.e. change 2024 to 2025 and 2025 to 2026.

 

HeaderNames = DATATABLE("Label", STRING, {
{"2024"},
{"2025"},
{"2025 vs 2024"},
{"%"}
})

 

So it's not really dynamic, is it?

 

 

Hi @mp390988 ,

Apologies, kindly try to below DAX.

VAR CurrentYear = YEAR(TODAY())
VAR PreviousYear = CurrentYear - 1

RETURN
DATATABLE("Label", STRING, {
{FORMAT(PreviousYear, "0000")},
{FORMAT(CurrentYear, "0000")},
{FORMAT(CurrentYear, "0000") & " vs " & FORMAT(PreviousYear, "0000")},
{"%"}
})

If this helps, please consider giving it a kudos and marking it as the accepted solution. 

mh2587
Super User
Super User

Check this video might help you
https://www.youtube.com/watch?v=IZ0pRXbB79M


Did I answer your question? If so, please mark my post as a solution!


Proud to be a Super User!




LinkedIn Icon
Muhammad Hasnain



Helpful resources

Announcements
July 2025 community update carousel

Fabric Community Update - July 2025

Find out what's new and trending in the Fabric community.

July PBI25 Carousel

Power BI Monthly Update - July 2025

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