Looking for solution to calculate the sum of revenue previous period using parameter control

periodToDateSum(Revenue,{transaction_date},‘Year’,${Enddate})
The present formula works to fetch present-year revenue

The end date is a parameter that has an end date in the 2020 year format, I want to subtract it to one year and check the previous year total revenue, I tried the different ways mentioned below did not work, let me know if you have a workaround for this

Tried, Did not work:
periodToDateSum({Revenue}, {transaction_date}, ‘YEAR’, addDate({Enddate}, -1 * dateDiff(‘YYYY’, {Enddate}, ‘today’), 'YYYY’))

periodToDateSum({Revenue}, {transaction_date}, 'YEAR’, addDateTime({Enddate}, -1, 'YYYY’))

Hi @akashmanjunatha123 ,

Have a look into following article Period Over Period and Other Date Comparison Calculations (YoY, MoM, YTD, Rolling 90 days, etc)

Further regarding your above question . I have used parameter to specify a date

Regards,
Koushik

1 Like