Sum all previous amounts, filtering by mont/year

Hi.
I need to sum amounts before a month/year filter. Creating the question as a sql I can't use month/year as a filter.
How I can solve that?
Example:
image

If the user filters by 06/2024 then the result should be the sum of amounts <= month/year.

Hi, @JeffreyWw2 , thank you for your answer.
We have a problem using field filter.
Metabase will update the variable {{date_filter}} by the string:
sale_date BETWEEN 'YYYY-MM-01' AND 'YYYY-MM-31'
If I choose the variable as a date, then the filter will be a date picker, not a month/year select;
for example.
Unless that I'm missing something.

Best regards