I think the problem is how you create MC_YearMonthID:
(Year(TempDate)-1)*100+Num(Month(TempDate)) as MC_YearMonthID
You will get values like 201401. What you get if you subtract 11 from that is 201390... which won't map to any real month and dates. So you get results that are too small.
You can use the autonumber function instead:
autonumber(monthstart(TempDate),'MonthCounter') as MC_YearMonthID.
Note: for this to work the dates in your master calendar need to be ordered chronologically.
To make things easier you could also use the qvc script library to generate your calendars. It will generate fields like above automatically and also a lot of very useful set modifiers for use in your set analysis expressions. See this discussion: Tutorial - Using Common Date Dimensions and Shared Calendars