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
Anonymous
Not applicable

Can we format row header in Matrix Visualisation in Power Bi?

I have a matrix visualizations.

 
 
 
 
 

I want to format the row headers on expanding and collapsing.

Use case is that in the matrix visual, Show values as Y if Years are visual,
if Years are extended to Quarters, show Q
else if Quarters are extended to Months show M

R5gD5.png

Is it possible in matrix visual ? If yes, then how can i implement this?

Thanks in advance!!

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @Anonymous 

I build a sample like yours to have a test.

1.png

Build a matrix visual:

2.png

Then build measure to achieve your goal.

Measure use IF function:

Total Sales =

IF (

    ISINSCOPE ( 'Table'[Year].[Day]),

    SUM('Table'[Sales]),

    IF (

        ISINSCOPE ( 'Table'[Year].[Month]),

        "M",

        IF (

            ISINSCOPE ( 'Table'[Year].[Quarter] ),

            "Q",

            IF ( ISINSCOPE ( 'Table'[Year].[Year] ), "Y",SUM('Table'[Sales]))

        )

    )

)

Or you can use a measure use Switch function:

Total Sales 2 =

SWITCH (

    TRUE (),

    ISINSCOPE ( 'Table'[Year].[Day] ), SUM ( 'Table'[Sales] ),

    ISINSCOPE ( 'Table'[Year].[Month] ), "M",

    ISINSCOPE ( 'Table'[Year].[Quarter] ), "Q",

    ISINSCOPE ( 'Table'[Year].[Year] ), "Y",

    SUM ( 'Table'[Sales] )

)

Result:

3.png

You can download the pbix file from this link: Can we format row header in Matrix Visualisation in Power Bi?

 

Best Regards,

Rico Zhou

 

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

4 REPLIES 4
Anonymous
Not applicable

Hi @Anonymous 

Could you tell me if your problem has been solved? If it is, kindly Accept it as the solution. More people will benefit from it. Or you are still confused about it, please provide me with more details about your problem or share me with your pbix file from your onedrive business.

 

Best Regards,

Rico Zhou

Anonymous
Not applicable

Hi @Anonymous 

I build a sample like yours to have a test.

1.png

Build a matrix visual:

2.png

Then build measure to achieve your goal.

Measure use IF function:

Total Sales =

IF (

    ISINSCOPE ( 'Table'[Year].[Day]),

    SUM('Table'[Sales]),

    IF (

        ISINSCOPE ( 'Table'[Year].[Month]),

        "M",

        IF (

            ISINSCOPE ( 'Table'[Year].[Quarter] ),

            "Q",

            IF ( ISINSCOPE ( 'Table'[Year].[Year] ), "Y",SUM('Table'[Sales]))

        )

    )

)

Or you can use a measure use Switch function:

Total Sales 2 =

SWITCH (

    TRUE (),

    ISINSCOPE ( 'Table'[Year].[Day] ), SUM ( 'Table'[Sales] ),

    ISINSCOPE ( 'Table'[Year].[Month] ), "M",

    ISINSCOPE ( 'Table'[Year].[Quarter] ), "Q",

    ISINSCOPE ( 'Table'[Year].[Year] ), "Y",

    SUM ( 'Table'[Sales] )

)

Result:

3.png

You can download the pbix file from this link: Can we format row header in Matrix Visualisation in Power Bi?

 

Best Regards,

Rico Zhou

 

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

amitchandak
Super User
Super User

@Anonymous , Doubt that. how would it look like? If you can share an example

 

refer this

https://www.kasperonbi.com/use-isinscope-to-get-the-right-hierarchy-level-in-dax/

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube
Anonymous
Not applicable

For Example:-

When I expand 2013 to the next level ie- Quarter then 2013 would be converted into text "Y" and when again I expand Quarter to next level then it would change to "Q" and so on .. for months as "M".

So, while expanding and collapsing, row header should be converted to the text that we provide.

Row header should be edited in every time on expanding the hiearchy. 

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.