Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
6 years ago
Solved

Matrix conditional format Background color each cell

Hi All,

I am currently looking to conditional format background color of each cell depending on column category & row value using conditions. Is there a way to do it? Please let me know.

 

Thanks

Susheel

  • Anonymous's avatar
    Anonymous
    6 years ago
    Hi Susheel,
    According to your description, it seems that you want to custom cell background color based on some rules, right?
    You could try to follow the steps:
    1. Create a new measure.
    2. Click the visualization ,then go to Fields in Visualizations pane.
    3. Right-click or select the down-arrow next to the field in the Values.
    4. Select Conditional formatting ,then Background color.
    5. In the pop-up window, Select Field value in Format by field and select the created measure in step1 for Based on field.
    For example, the following formula applies different color values to Units Sold column, based on the value of Discount Band and Units Sold columns.

     

     

    Discount Band color =
    SWITCH (
        TRUE (),
        SUM ( financials[Units Sold] ) < 50000
            && SELECTEDVALUE ( financials[Discount Band] ) = "High", "Yellow",
        SUM ( financials[Units Sold] ) > 50000
            && SELECTEDVALUE ( financials[Discount Band] ) = "Low", "Red"
    )

     

     
    My example table with Units Sold background color based on calculated looks like this:
    Is this result what you want? If you have any questions, please upload some data samples and expected output.
    Please do mask sensitive data before uploading.
     
    Best Regards,
    Eyelyn Qin

     

2 Replies

  • Anonymous's avatar
    Anonymous
    Not applicable
    Hi Susheel,
    According to your description, it seems that you want to custom cell background color based on some rules, right?
    You could try to follow the steps:
    1. Create a new measure.
    2. Click the visualization ,then go to Fields in Visualizations pane.
    3. Right-click or select the down-arrow next to the field in the Values.
    4. Select Conditional formatting ,then Background color.
    5. In the pop-up window, Select Field value in Format by field and select the created measure in step1 for Based on field.
    For example, the following formula applies different color values to Units Sold column, based on the value of Discount Band and Units Sold columns.

     

     

    Discount Band color =
    SWITCH (
        TRUE (),
        SUM ( financials[Units Sold] ) < 50000
            && SELECTEDVALUE ( financials[Discount Band] ) = "High", "Yellow",
        SUM ( financials[Units Sold] ) > 50000
            && SELECTEDVALUE ( financials[Discount Band] ) = "Low", "Red"
    )

     

     
    My example table with Units Sold background color based on calculated looks like this:
    Is this result what you want? If you have any questions, please upload some data samples and expected output.
    Please do mask sensitive data before uploading.
     
    Best Regards,
    Eyelyn Qin