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
Lamati
Frequent Visitor

Conditional formatting of fields in a table based on the result of another field

Good afternoon; I have only been doing reports in Power BI for a short time and I don't know if the question I propose will have a solution.

I have a table with different fields that make up the metadata of several projects. Each field represents a characteristic of a list of projects. To know if these fields are complete or not, we have created a table in which we count the rows of these fields for each project. The total number of projects has been put in a label that shows the count of the project ids.

 

A conditional format has been applied to the fields of the table in which, using gradient colours, if the count of the field coincides with the count of projects, the colour is green, and as this number gets smaller and closer to zero, it changes to yellow and red.

Captura de pantalla 2023-01-23 151155.jpg

El problema es que si se selecciona un proyecto en concreto, aunque el total de 

Captura de pantalla 2023-01-23 151139.jpg

The problem is that if a particular project is selected, even if the total number of project rows matches the number of rows that must be in that field, the columns of the table appear in red, because the colour gradient has been made based on fixed values.

Captura de pantalla 2023-01-23 151936.jpg

 

Is there a way to format this by creating a measure that applies to all columns and sets the colour depending on whether the count in each column matches the total number of rows in the projects?

 

Thanks in advance for your help

1 REPLY 1
amitchandak
Super User
Super User

@Lamati , You can use measure  based conditional formatting and you can use that measure in conditional formatting using field value option

 

example measures

 

Color Date = if(FIRSTNONBLANK('Date'[Date],TODAY()) < date(2022,04,10) ,
Switch(true(),
[SLA] = 1 , "Green" ,
[SLA] >= .75 , "Amber" ,
"Red "
) ,
Switch(true(),
[SLA] = 1 , "Green" ,
[SLA] >= .5 , "Amber" ,
"Red "
)
)

 

Color = Switch( True() ,
Max(Table[Status]) < 200 ,
Switch(true(),
[ERB] = .25 , "Orange" ,
"Red "
) ,
Max(Table[Status]) < 500 ,
Switch(true(),
[ERB] = .25 , "Orange" ,
"Red "
) ,
Switch(true(),
[ERB] = .25 , "Orange" ,
"Red "
)
)

 

 

How to do conditional formatting by measure and apply it on pie?
https://www.youtube.com/watch?v=RqBb5eBf_I4&list=PLPaNVDMhUXGYo50Ajmr4SgSV9HIQLxc8L
https://community.powerbi.com/t5/Community-Blog/Power-BI-Conditional-formatting-the-Pie-Visual/ba-p/...
https://amitchandak.medium.com/power-bi-where-is-the-conditional-formatting-option-in-new-format-pan...

Full Power BI Video 20 Hours YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

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.