'SQL - How do I expand a dataset to do a cohort analysis?

This is my first post so apologies if something is posted incorrectly - please let me know and I will fix it. I am trying to build a SQL query in bigQuery that creates a cohort analysis so I can see how many customers have been retained over time by the month they joined (their cohort). I work in insurance, so we have data on customers, when they joined, and any time they changed the policy (e.g., when they added a car to their coverage), but I do not have it laid out as every month of premium. The data is as follows:

Data vs how I need the data

Do you know how I could fill in the missing months?



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source