Error while adding calculated field in a view

Trying to create this calculation
ifelse(
{Date Month} = 2,
COALESCE({Actual Revenue CY}, 0) - COALESCE({Actual Revenue PY}, 0),
NULL
)

It gets created but upon pulling it to a visual, I am getting an error.

Hi @Hunny ,

I tried the same and it worked for me. Could you please tell if datamonth is integer or string and if the two fields (Actual Revenue Cy, Actual Revenue PY) are aggregated?

1 Like

datemonth is integer and the other two fields are not aggregated.

ifelse({Date Month} = 1,
{Actual Revenue CY} - {Actual Revenue PY},
NULL)
also gives error