To consider also the previous year you only have to adjust the filter expression and the expression of the calculated column. In the following examples the "in" function is used to compare the column against the entered year value and the calculated previous year value.
Filter expression:
in(string(component("CreatedOn",1)) ,'$$IP_YEAR$$',string(int('$$IP_YEAR$$')-1)) or in(string(component("PostingDate",1)) ,'$$IP_YEAR$$',string(int('$$IP_YEAR$$')-1))
Expression for calculated column (for instance for the CreatedOn column):
if(in(string(component("CreatedOn", 1)) ,'$$IP_YEAR$$', string(int('$$IP_YEAR$$'))-1),1,0)
Regards,
Florian