Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
2 years ago
Solved

Conditional Formatting - Matrix Table

Hi Team,

 

I have below table and created Matric table in PI file, now I need to highlight rows wise if value mismatch.

 

  • So if I understood correctly all values in the same category should be the same, otherwise be highlighted. Find attached my proposed solution. I adapted NikhilChenna 's recommendation into this formula:

    Color Logic = IF(SUM('Table'[Cat14]) <> SUM('Table'[Cat15]) || SUM('Table'[Cat14])<> SUM('Table'[Cat16]) || SUM('Table'[Cat15])  <> SUM('Table'[Cat16]), "#FF7F7F", "#FFFFFF") 

    You would need to pivot your table though, assuming you don't have other data. 

     

8 Replies

  • Hi Anonymous ,

    Please follow the below steps to get your conditional formatting, 

    1. Select the matrix visual in Power BI Desktop.
    2. Click on the "Format" pane (paint roller icon) on the right side.
    3. Under the "Values" section, select the field that corresponds to the values in columns 14, 15, and 16.
    4. Scroll down to the "Conditional formatting" section and click on the ellipsis (...) button.
    5. Choose "Background color scales" or "Font color scales" based on your preference.
    6. In the "Minimum" and "Maximum" conditions, set the rules for when the entire row should be colored.
    7. For your case, you want to color the row when the values in columns 14, 15, and 16 do not match. You can use the following steps:
      1. Click on "Add rule." 
      2. Set the condition as "is not equal to." 
      3. Specify the field or value for comparison. You may need to write a DAX expression to compare the values in columns 14, 15, and 16. For example, if your fields are named [Column14], [Column15], and [Column16], the DAX expression could be something like:
         
        =IF([Column14] <> [Column15] || [Column14] <> [Column16] || [Column15] <> [Column16], 1, 0
         
        4. Set the color for when this condition is met.
    8. Click "OK" to apply the conditional formatting.

    These steps should help you achieve the desired result of coloring the entire row when the values in columns 14, 15, and 16 do not match. Adjust the DAX expression and conditional formatting rules as per your specific dataset and requirements.

     

    Regards,

    Nikhil Chenna

     

    If your issues resolves select my post as a solution and gives a thumbsup.

    • Anonymous's avatar
      Anonymous
      Not applicable

      Hi NikhilChenna 
      If the 14,15 and 16 is the single column then what is the dax function, Please advise

      • NikhilChenna's avatar
        NikhilChenna
        Skilled Sharer

        Hi Anonymous ,

        You can try the below ,

        =IF([Value] <> EARLIER([Value]), 1, 0)

        Regards,

        Nikhil Chenna

        If your issues resolves select my post as a solution and gives a thumbsup.