Not certain I understand what you hope to achieve in the db but you do so that's all that counts
any way the year associated with the max date (filtered) in your viz is
If this posts assists in resolving the question, please mark it helpful or as the 'correct answer' if it resolves the question. This will help other users find the same answer/resolution. Thank you.
If you have an end date parameter, then you just need to do
YEAR([End Date Parameter])
And you'll know that last year you're looking to display.