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

To celebrate FabCon Vienna, we are offering 50% off select exams. Ends October 3rd. Request your discount now.

Reply
tomperro
Helper V
Helper V

Dynamic Headers in a Matrix Visual

I am trying to dynamically update my table matrix headers using paramters.

I would like the headers to updated based on slicer selections.
Example:

tomperro_0-1728504737521.png

 



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
65465654987654321
2 REPLIES 2
Anonymous
Not applicable

Hi @tomperro 

 

Dynamic headers are not currently available in power bi desktop, you can try a workaround:

 

Here's some dummy data

 

"table"

vnuocmsft_0-1728526712987.png

 

"Date"

Date = 
SELECTCOLUMNS(
    'Table',
    "Select Date",
    'Table'[Date]
)

vnuocmsft_1-1728526731436.png

 

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.

 

vnuocmsft_2-1728526841373.png

 

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

Helpful resources

Announcements
September Power BI Update Carousel

Power BI Monthly Update - September 2025

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

August 2025 community update carousel

Fabric Community Update - August 2025

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

Top Solution Authors
Top Kudoed Authors