Forum Discussion

PetrM's avatar
PetrM
Frequent Visitor
3 years ago

Conditionally format Total row in a Matrix visual

I have a Matrix visual with values conditionally formatted based on row header categoris (green, yellow and red categories -> accordingly colored rows). The following measure does the job:
Color Measure =
switch ( FIRSTNONBLANK(DimColors[Color],"NA"),
    "red","#fa4755",
    "yellow", "#a38600",
    "green", "#20bd20",
    "#bcbcbc"
)
 
This works well, except for the total row, which turns out green. How do I take control over the Total row color?
Any help would be much appreciated.

4 Replies

  • KeyurPatel14's avatar
    KeyurPatel14
    Responsive Resident

    Hi PetrM ,
    Hope you are doing well.
    If I understand your requirement correctly then I think you can use ISFILTERED() DAX Formula to get control over the Total row color. You can use ISFILTERED() function inside IF() function with the color measure you have.
    If you have any queries then please let me know or you can also share your pbix file so that I can help you.
    If this give you any idea or helps you in your problem then give it a kudos and please accept it as a solution.
    Thank you.

    • PetrM's avatar
      PetrM
      Frequent Visitor

      Thank you KeyurPatel14 - I was playing with the ISFILTERED() since that is what ChatGPT also recommended. But I was unable to make it work.

      Here is a picture and a pbix example.

       

      • KeyurPatel14's avatar
        KeyurPatel14
        Responsive Resident

        Access was required to download the file so I have sent the request kindly accept it so that I can download the pbix.
        Thank you.