You can do this with field filters, this should help: https://www.metabase.com/learn/building-analytics/sql-templates/sql-variables.html