Forum Discussion
Dynamic Column headers using Field Parameters
- Anonymous1 year ago
Hi Emmy66 ,
Glad to hear it worked in the Matrix visual. Unfortunately, Tables in Power BI don’t allow you to ‘replace’ or ‘override’ the column headers the way a Matrix does. A Table always shows the actual field names from your model. That’s why the disconnected Header Table + SWITCH logic works in Matrix (because the headers come from the Header Table), but not in Table.
Thank you
Hi Emmy66 ,
Thanks for reaching out to the Microsoft fabric community forum.
Field Parameters are too dynamic for your use case. A disconnected table with SWITCH measures gives you year-stable headers that you only update once annually, not every quarter.
1) Create a custom “Header Table” – a simple disconnected table with the values you want to show as headers for the year (e.g. Q1 2025, Q2 2025, Q3 2025, Q4 2025).
HeaderTable =
DATATABLE(
"Header", STRING,
{
{"Q1 2025"},
{"Q2 2025"},
{"Q3 2025"},
{"Q4 2025"}
}
)
2) Use SWITCH logic to tie measures to these headers.
Sales by Header =
SWITCH(
SELECTEDVALUE(HeaderTable[Header]),
"Q1 2025", [Sales Q1 2025],
"Q2 2025", [Sales Q2 2025],
"Q3 2025", [Sales Q3 2025],
"Q4 2025", [Sales Q4 2025]
)
This way, the column headers will remain as “Q1 2025, Q2 2025…” until you replace the HeaderTable values at the end of the year.
3) Control Header Roll-over: When moving into 2026, you just update the HeaderTable to show “Q1 2026, Q2 2026…” and your visuals will immediately align without having to edit the visual headers manually.
This is the expected output
Attaching the sample .pbix for reference.
I hope this information helps. Please do let us know if you have any further queries.
Thank you
Anonymous, thanks for the proposed solution. Very much appreciated. I've tried implementing that and it worked for Matrix but not for Table. Any idea how this can be achieved using a table please.
- Anonymous1 year agoNot applicable
Hi Emmy66 ,
Glad to hear it worked in the Matrix visual. Unfortunately, Tables in Power BI don’t allow you to ‘replace’ or ‘override’ the column headers the way a Matrix does. A Table always shows the actual field names from your model. That’s why the disconnected Header Table + SWITCH logic works in Matrix (because the headers come from the Header Table), but not in Table.
Thank you