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

The Power BI DataViz World Championships are on! With four chances to enter, you could win a spot in the LIVE Grand Finale in Las Vegas. Show off your skills.

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
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

FebPBI_Carousel

Power BI Monthly Update - February 2025

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

Feb2025 NL Carousel

Fabric Community Update - February 2025

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