widget setting to a cutoff date

widget setting to a cutoff date

I need to configure a widgets so that it compares information to the cut of a date, for example the sale of this month accumulated to today 10/12/2021 vs. the accumulated sale of the previous month accumulated as of 09/12/2021?