I am trying to generate 2 calculated fields that generate the average value of the current and previous fiscal year (Examples: the 2019 fiscal year starts from July 2018 to the current date, fiscal year 2018 starts from July 2017 to June 2018);

the idea is that these 2 calculated fields work dynamically, that is, the current fiscal year to pass the time should be updated to the new fiscal year to reach July (in July starts the new fiscal year) in addition to this, the calculated field must interact with the filters: Category and State.

I copy image of the value that should generate both calculated fields (Current Fiscal Year and Previous Fiscal Year),