Filter by date dashboard

We have a table with yearly accumulated data and I would like to be able to filter it by date to show me the accumulated data from previous years up to today (to make a comparison with the current year). How can I do this?