Parameter in calculated field syntax error

Hi @auripol and welcome to the QuickSight community!
I understand what you’re trying to do but there are other functions available that may assist with this type of requirement a bit easier.
Here is some documentation to review regarding period over period computations; there are various ways to handle this based on what works best for your data/scenario.
Based on your scenario, there can be issues with the periodOverPeriodDifference; if so I would suggest looking further into the lag function; the second document below is a prior community post that discusses the use of it further.

Let me know if one of these options works towards your case or if you have any additional questions