Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!To celebrate FabCon Vienna, we are offering 50% off select exams. Ends October 3rd. Request your discount now.
I am trying to dynamically update my table matrix headers using paramters.
I would like the headers to updated based on slicer selections.
Example:
Selected End Date Count for 4/2024 | Month Prior to Selected Date Count for 03/2024 | Entire Date Range Selection Count for 7/2023- 7/2024 |
65465 | 654987 | 654321 |
Hi @tomperro
Dynamic headers are not currently available in power bi desktop, you can try a workaround:
Here's some dummy data
"table"
"Date"
Date =
SELECTCOLUMNS(
'Table',
"Select Date",
'Table'[Date]
)
Create measures.
Selected End Date Month =
var _max = MAX('Date'[Select Date])
var _count =
CALCULATE(
SELECTEDVALUE('Table'[Value]),
FILTER(
ALL('Table'),
FORMAT('Table'[Date], "mm/yyyy") = FORMAT(_max, "mm/yyyy")
)
)
RETURN
"Count for "
&
FORMAT(_max, "mm/yyyy")
&
" "
&
_count
Prior to Selected Date Entire =
var _prior = EOMONTH(MAX('Date'[Select Date]),-1)
var _count =
CALCULATE(
SELECTEDVALUE('Table'[Value]),
FILTER(
ALL('Table'),
FORMAT('Table'[Date], "mm/yyyy") = FORMAT(_prior, "mm/yyyy")
)
)
RETURN
"Count for " & FORMAT(_prior,"mm/yyyy") & " " & _count
Date Range Selection =
var _min = MIN('Date'[Select Date])
var _max = MAX('Date'[Select Date])
var _count =
CALCULATE(
SUM('Table'[Value]),
FILTER(
ALL('Table'),
FORMAT('Table'[Date], "mm/yyyy") >= FORMAT(_min, "mm/yyyy")
&&
FORMAT('Table'[Date], "mm/yyyy") <= FORMAT(_max, "mm/yyyy")
)
)
RETURN
"Count for " & FORMAT(_min,"mm/yyyy") & "-" & FORMAT(_max,"mm/yyyy") & " " & _count
Here is the result.
You can change the calculation based on your data.
Regards,
Nono Chen
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
That is a good solution, however this will not work due to the requirements of the reports.
Thank you