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

To celebrate FabCon Vienna, we are offering 50% off select exams. Ends October 3rd. Request your discount now.

Reply
AndrewPF
Helper V
Helper V

conditional formatting not working for every row in a table

I have a text field called "Status" and I have created a numeric "Status Numeric" as follows:

 

if [status] = "Not Started" then 1 else if [status] = "Past Due" then 1 else if [status] = "In Progress" then 2 else if [status] = "Passed" then 3 else 0, Int64.Type

 

Because it is not possible to apply conditional formatting to a text field (or is it?), I have applied it based on the value of "Status Numeric":

 

AndrewPF_0-1658756697929.png

 

and this is where the problem occurs. Some of the "Status" fields are formatted correctly, some aren't: 

 

AndrewPF_2-1658756821814.png

 

and there seems to be no pattern. 

 

I wonder if it's something to do with the "Sum" element of the conditional format: 

 

AndrewPF_3-1658756875006.png

 

 

but, if it isn't, I have no other ideas. 

1 ACCEPTED SOLUTION
amitchandak
Super User
Super User

@AndrewPF , You write a color measure and use that in conditional formaating

 

Switch(True() ,

[status] in {"Not Started", "Past Due"}  , "Red" ,

[status] in {"In Progress"} , "Yellow",

"Green"

)

 

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

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

View solution in original post

1 REPLY 1
amitchandak
Super User
Super User

@AndrewPF , You write a color measure and use that in conditional formaating

 

Switch(True() ,

[status] in {"Not Started", "Past Due"}  , "Red" ,

[status] in {"In Progress"} , "Yellow",

"Green"

)

 

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

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Helpful resources

Announcements
September Power BI Update Carousel

Power BI Monthly Update - September 2025

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

August 2025 community update carousel

Fabric Community Update - August 2025

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

Top Solution Authors