Alex,
At the bottom of this page you’ll see several tokens you can use for this purpose: https://docs.mendix.com/refguide/xpath-keywords-and-system-variables#1-overview
For instance, to get the last 2 years on a rolling basis, the Xpath would look like this:
EndDate > '[%BeginOfCurrentDay%] - 2 * [%YearLength%]']
Hope this helps,
Mike