Hi @Spike_naylor,
Do you want to achieve [Plan Completion] "on or before" [Plan Due Date], color it green, or if [Plan Completion] is "after [Plan Due Date]", color it red?
Here is a test for your reference:
Plan Due Date:
Date Detected:
Plan Completed
Here is Code
{
"$schema": "https://developer.microsoft.com/json-schemas/sp/v2/column-formatting.schema.json",
"elmType": "div",
"style": {
"box-sizing": "border-box",
"padding": "0 2px",
"overflow": "hidden",
"text-overflow": "ellipsis"
},
"attributes": {
"class": {
"operator": ":",
"operands": [
{
"operator": "<=",
"operands": [
{
"operator": "Date()",
"operands": [
{
"operator": "toDateString()",
"operands": [
"@currentField"
]
}
]
},
{
"operator": "Date()",
"operands": [
{
"operator": "toDateString()",
"operands": [
"[$Plan_x0020_Due_x0020_Date]"
]
}
]
}
]
},
"sp-css-backgroundColor-BgGreen sp-css-borderColor-GreenFont sp-field-fontSizeSmall sp-css-color-GreenFont",
{
"operator": ":",
"operands": [
{
"operator": ">",
"operands": [
{
"operator": "Date()",
"operands": [
{
"operator": "toDateString()",
"operands": [
"@currentField"
]
}
]
},
{
"operator": "Date()",
"operands": [
{
"operator": "toDateString()",
"operands": [
"[$Plan_x0020_Due_x0020_Date]"
]
}
]
}
]
},
"sp-css-backgroundColor-BgRed sp-css-borderColor-RedFont sp-field-fontSizeSmall sp-css-color-RedFont",
""
]
}
]
}
},
"txtContent": "@currentField.displayValue"
}
Here is test result:
If the answer is helpful, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.
Best Regards
Cheng Feng