If you have a closer look at the second to last line of your load script you will find that you have misplaced the +recno()-1 and you can also get rid of the two Date() functions you are using as they serve no purpose. This should work as your last three lines of your load script:
MonthEnd(AddMonths(YearStart(today()),-60+RecNo()-1)) as Date
I was able to correct the issue and get the calendar I want by adding the Date() function in front of Month end date.
Now I get what I need. I renamed these fields as valuation date, etc. in order to match my fact table. That works and the model looks correct. However, when I try to use the valuation date and valuation month year fields I get odd results. See below First off you will notice i'm getting 2 of every valuation date, even though I only have one in my qvd calendar file. Why is that happening?
The other is that the 2 aren't relating correctly. If I choose 3/31/2013 my data changes but the valuation month year gets nulled out.
Similar happens when I choose March 2013, everything gets 0'd out. Why would that be?
The 12 was just a placeholder for your variable ... The logic will work for the last 5 years if you replace it with 60. Misleading of me to not do that in the first place - it was my "test"/dummy code that I forgot to thoroughly go through before I posted it...