Forum Discussion
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":
and this is where the problem occurs. Some of the "Status" fields are formatted correctly, some aren't:
and there seems to be no pattern.
I wonder if it's something to do with the "Sum" element of the conditional format:
but, if it isn't, I have no other ideas.
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/1682539
1 Reply
- amitchandak
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/1682539