12-13-2017 06:20 AM
I've found that creating a date table with every required breakdown of the date (ie: Month number, Week number) is a good practice. This numbering should just be a sequential number from the begining of your date range of the date table to the most recent date. That way you can use simple DAX like: Lead PM = CALCULATE([Leads], FILTER(ALL(CreateDateTable), CreateDateTable[MonthNumber]= MAX(CreateDateTable[MonthNumber])-1). If the MonthNumber is a running number from 1 to 36 for a 3 yr period, then you don't won't have an issue considering the year. Same can apply to Week number.
This article was helpful: http://www.daxpatterns.com/time-patterns/
03-02-2018 09:37 AM
Here are some tutorials on generating a date calendar with an Index for months, Years, Days, and weeks. This uses the same logic as @steph_io Great solution.