I am looking to do a YoY%, MoM% and QoQ% difference for the following data within a date range. I currently used this calculated fields below which worked ok if the date range picked is for 1 month for example 1st -31st July:
Current Period: ifelse({snapshot_day}>=${StartDate} and {snapshot_day}<=${EndDate},1,0)
Same Period Last Year: ifelse({snapshot_day}>=addDateTime(-1,‘YYYY’,${StartDate}) AND {snapshot_day}<=addDateTime(-1,‘YYYY’,${EndDate}),1,0)
YoY %: sum({Current Period}) / sum(Same Period Last Year}) -1
I need the MoM% and QoQ% to populate if lets say 6 months are picked in the date range as indicated below: