Current year: IF DATEPART('year',[Date]) = YEAR(TODAY()) THEN [ID] END
Previous Year: IF DATEPART('year',[Date]) = YEAR(TODAY())-1 THEN [ID] END
Post the sample data if it doesn't work.
with this calculation it is not getting fixed to one year, if you select other year it will change, I want to fix the calculation to one specific year
Are you using the parameter or Filter.
If you are using filter as you said value will changes accordingly ,
If you are using parameter then the o/p will be constant.
Kindly post your workbook so it will help to analyze more.
You please attach the .TWBX file and expected result.
I have attached sample workbook...I have calculated sales for 2016 AND 2017 but when I select filter 2015 then also thse should be displaying only 2016 and 2017 data and should not be affected with filter selection