Define the variable is it possible in calculated field or not

Hi team please tell me like below calculated field will be work in calculated field or not

i have define the variable here but result one iam getting the error

please clarify

var last_month= sum(ifelse(
truncDate(‘MM’, date) = truncDate(‘MM’, addDateTime(-1, ‘MM’, now())),
{Generated value},
0
))

var last_to_last_month=sum(ifelse(
truncDate(‘MM’, date) = truncDate(‘MM’, addDateTime(-2, ‘MM’, now())),
{Generated value},
0
))

ifelse({last_to_last_month}=0,1,({last_month}-{last_to_last_month})/{last_to_last_month})

Hi @vinodkumarb
it’s not possible to define variables.
You could create three different calculated field or use the full logic within one calculated field.
BR

okey @ErikG thanks for the quick reply
it should be update in the future or it will be like that only
becouse in tableau and power bi we have have alike that option variable define