# Calculation based on the average of the last 6 months

HI

I would like to understand how I can set up a box like this below comparing not with last year, but with the average of the last 6 months

for example I would need to compare from 1 to 19 September 2023 with the average of the first 19 days of the month in the last semester
the calculation should then update every day and reset at the end of the month and then start again with the following month

thanks
andrea

Hi @andreab,

Kindly review the documentation below.

Regards,
Demola

Hi @demola

ok for comparison with last year I use this calculation

ifelse(

({conversion_date}>=\${datainizio} AND {conversion_date}<=\${datafine}) OR ({conversion_date}>=(addDateTime(-1, ‘YYYY’, \${datainizio})) AND {conversion_date}<= (addDateTime(-1, ‘YYYY’, \${datafine}))), “OK”,“NO”)

how can I set everything with average compared to my initial question?

figured out how to fix it

it was enough to set a target value that contained the total of the last 6 months divided by 6