Aggregate formula to get previous months data

Aggregate formula to get previous months data

Hello, I was wondering if there is a way to write formula to get the data from the previous month? So I would want to get the sum of sales from previous month to use it in the current month.

thank you