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
Anonymous
Not applicable

Conditional formatting by row

Hello Everyone,

 

I have a data set showing in a matrix. The rows indicate the KRI and then I have the Quarters as columns.

I would like to do conditional formating on the visualization that can be different for each row. I  could only manage to have the conditional formating be based on a specific value.

 

To better understand the data, I have a column for Key Risk Indicators and another column for its value. The values are entered manually each month by the user after selecting the right date.

 

ahmed1997_0-1658644848488.png

 

 

 

Thank You

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @Anonymous ,

 

Agree with @VijayP  that you need to create a measure for multiple conditions.

 

Below is my example:

Conditional Formatting = 
SWITCH(TRUE(), 
CONTAINSSTRING(MAX('Table'[KRI]),"Budgeted Gross Margin"), IF(SUM('Table'[Value])>12,"Light Green","Red"),
CONTAINSSTRING(MAX('Table'[KRI]),"Days Inventory"), IF(SUM('Table'[Value])<=35,"Red", IF(SUM('Table'[Value])<=45,"Yellow","Green")), 
"Light Blue")

Output:

Eyelyn9_0-1658905279119.png

 

Best Regards,
Eyelyn Qin
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

4 REPLIES 4
Anonymous
Not applicable

Hi @Anonymous ,

 

Agree with @VijayP  that you need to create a measure for multiple conditions.

 

Below is my example:

Conditional Formatting = 
SWITCH(TRUE(), 
CONTAINSSTRING(MAX('Table'[KRI]),"Budgeted Gross Margin"), IF(SUM('Table'[Value])>12,"Light Green","Red"),
CONTAINSSTRING(MAX('Table'[KRI]),"Days Inventory"), IF(SUM('Table'[Value])<=35,"Red", IF(SUM('Table'[Value])<=45,"Yellow","Green")), 
"Light Blue")

Output:

Eyelyn9_0-1658905279119.png

 

Best Regards,
Eyelyn Qin
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Anonymous
Not applicable

Hello @Anonymous 

Thank you for the reply it helped a lot.

However, When I tried to do the conditional formating I ran into the following issue.

In the measure for Budgeted Gross Margin - Packaging i have set the rule for if the value is less than 5 then it should be red. but it is still showing as yellow in the Visualization.

 

measure   .pngoutput.png

Thank You

Anonymous
Not applicable

So I fixed this.

All I had to do was replace sum with averge, since in my case I am taking the average of all the values for each quarter.

VijayP
Super User
Super User

@Anonymous 

Create a measure for conditional formatting and use the field value option to create conditional formatting

I think you are currently using the UI conditional formatting which is not dynamic




Did I answer your question? Mark my post as a solution! Appreciate your Kudos!!
MY Blog || My YouTube Channel || Connect with me on Linkedin || My Latest Data Story - Ageing Analysis

Proud to be a Super User!


Helpful resources

Announcements
July PBI25 Carousel

Power BI Monthly Update - July 2025

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

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 community update carousel

Fabric Community Update - June 2025

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