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

Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.

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
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

September Power BI Update Carousel

Power BI Monthly Update - September 2025

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

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
Top Kudoed Authors