Okay, it sounds like you’re trying to do Customer Retention Analysis or Cohort Retention Analysis.
You would make a where-clause that was a sub-query, checking if the customer has been active the last 12 months from whatever month you’re querying in the current lower sub-query.
You might need to redo some of your initial query, since it already contains several levels of queries, but it depends on your data size and indexing, so if everything is still fast, then it’s not that important.
Also check this thread: Customer cohort and retention analysis
Otherwise try to do a bit of searching for either of the terms - there are many examples on stackoverflow and similar sites.