The value returned by lookup colum is of string type, and the date you need to compare is of date type, so this json will be invalid.
We should convert the sting type to the date type:
if(Date(@currentField.lookupValue)
Please refer to the full code below:
{
"$schema": "https://developer.microsoft.com/json-schemas/sp/v2/column-formatting.schema.json",
"elmType": "div",
"debugMode": true,
"txtContent": "@currentField.lookupValue",
"style": {
"color": "=if(Date(@currentField.lookupValue)<= @now, '#ec4d37', '')",
"font-weight": "=if(Date(@currentField.lookupValue) <= @now, 'bold', 'normal')"
}
}
If an Answer is helpful, please click "Accept Answer" and upvote it.
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.