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
ase
Frequent Visitor

Dynamic title field on a matrix

Hi all,

 

I have a matrix with a title, but it looks a bit ugly because the title field does not dynamically change based on the drill downs/ups. 

 

Do you know a way (setting) that would make the title adjust and follow the size of the table below? At this point even if I resize the fields below manually, there is still a gap between the title and the table. 

 

ase_0-1697619976118.png

ase_0-1697620255205.png

 

 

Thank you very much for the help in advance

 

Kind regards,

B

 

 

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @ase ,

There is a way to create a dynamic title for your matrix is to use a DAX measure that returns a text value based on the filter context of the matrix. You can then use the conditional formatting option in the title settings of the matrix to select the measure as the title text. For example, you can create a measure like this:

 

Matrix Title =
VAR current_month =
    SELECTEDVALUE ( Calendar[Month] )
VAR current_year =
    SELECTEDVALUE ( Calendar[Year] )
RETURN
    IF (
        ISFILTERED ( Calenda[Month] ) && ISFILTERED ( Calendar[Year] ),
        "Sales for " & current_month & " " & current_year,
        "Sales by Month and Year"
    )

 

This measure will return a different title depending on whether the matrix is drilled down or up by month and year.

Expression-based titles in Power BI Desktop - Power BI | Microsoft Learn

 

How to Get Your Question Answered Quickly 

 

If it does not help, please provide more details with your desired output and pbix file without privacy information (or some sample data) .

 

Best Regards
Community Support Team _ Rongtie

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

 

 

 

View solution in original post

1 REPLY 1
Anonymous
Not applicable

Hi @ase ,

There is a way to create a dynamic title for your matrix is to use a DAX measure that returns a text value based on the filter context of the matrix. You can then use the conditional formatting option in the title settings of the matrix to select the measure as the title text. For example, you can create a measure like this:

 

Matrix Title =
VAR current_month =
    SELECTEDVALUE ( Calendar[Month] )
VAR current_year =
    SELECTEDVALUE ( Calendar[Year] )
RETURN
    IF (
        ISFILTERED ( Calenda[Month] ) && ISFILTERED ( Calendar[Year] ),
        "Sales for " & current_month & " " & current_year,
        "Sales by Month and Year"
    )

 

This measure will return a different title depending on whether the matrix is drilled down or up by month and year.

Expression-based titles in Power BI Desktop - Power BI | Microsoft Learn

 

How to Get Your Question Answered Quickly 

 

If it does not help, please provide more details with your desired output and pbix file without privacy information (or some sample data) .

 

Best Regards
Community Support Team _ Rongtie

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

 

 

 

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.

Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.