How to set the default date to last years today

I want to set the default date to, last years today.

Right now, I am using the field filter.
The default date is set as today.
But I also want to compare it with the last years today too.

I know that if you do, -364days from today I can get last years today.
But when it’s the leap year this won’t work.

I am using postgres.
If Metabase or SQL has a solution for my issue, please help me out.
Thank you.

Hi @coro

That’s currently not possible, but it’s currently on the roadmap for 0.38 (not a guarantee):
https://github.com/metabase/metabase/issues/4509 - upvote by clicking :+1: on the first post

You would have to use simple Date filter, so you can use the variable again minus a year.

To account for leap year and things like that, you’ll need to do some more SQL - but that has nothing to do with Metabase, and you might find better ways to do it on stackoverflow.com

1 Like