Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Join us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.

Reply
PetrM
Frequent Visitor

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 4
KeyurPatel14
Responsive Resident
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.

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.

PetrM_0-1679155556627.png

 

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.

I'm sorry, I believed I created a public link. It should be ok now. Thank you for not giving up.

Helpful resources

Announcements
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.

June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

Check out the June 2025 Power BI update to learn about new features.

June 2025 community update carousel

Fabric Community Update - June 2025

Find out what's new and trending in the Fabric community.