Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
4 years ago
Solved

How to make differing background colours for row and column totals in Matrix Visual?

Dear BI Community,

 

In the below matrix visual, I want the row total background color to be Navy Blue and I want the Column total to be sky blue.

 

Currently I only know how to simultaneously make these the same color. How can I make the column and row total background colors different? Thank you for your help everyone.

 

 

  • Here is one way to do it. Create a measure like this, using the fields used in the Rows and Columns of your matrix. Change the "Blue", "Yellow", etc. to the hex codes for the colors you want. Then use the measure in conditional formatting for your measure, choosing Field Value and Totals Only as shown.

     

     

    Matrix Color =
    VAR isrowtotal =
        NOT ( ISFILTERED ( 'Date'[Year] ) )
    VAR iscoltotal =
        NOT ( ISFILTERED ( 'Product'[Category] ) )
    RETURN
        SWITCH (
            TRUE (),
            AND ( isrowtotaliscoltotal )"Green",
            isrowtotal"Blue",
            iscoltotal"Yellow"
        )

     

    Pat

     

1 Reply

  • mahoneypat's avatar
    mahoneypat
    Icon for Microsoft Employee rankMicrosoft Employee

    Here is one way to do it. Create a measure like this, using the fields used in the Rows and Columns of your matrix. Change the "Blue", "Yellow", etc. to the hex codes for the colors you want. Then use the measure in conditional formatting for your measure, choosing Field Value and Totals Only as shown.

     

     

    Matrix Color =
    VAR isrowtotal =
        NOT ( ISFILTERED ( 'Date'[Year] ) )
    VAR iscoltotal =
        NOT ( ISFILTERED ( 'Product'[Category] ) )
    RETURN
        SWITCH (
            TRUE (),
            AND ( isrowtotaliscoltotal )"Green",
            isrowtotal"Blue",
            iscoltotal"Yellow"
        )

     

    Pat