I added an input box to show the value of the vCompareDate variable and it turned out that the formats differed, so I changed the format of the variable like this:
LET vCompareDate = date(AddMonths(Peek('UptimeDate', -1, 'UptimePerDayTemp3'), -1), 'M/D/YYYY');
But the If statement still only evaluates to True.
The UptimeDate field in the table contains every date from 1/4/2010 to 4/1/2012.
The vCompareDate variable contains "3/1/2012" (1st of March).
Yes, they both have the format 'M/D/YYYY'. I tried your suggestion without any luck, but then I tried using Num instead (since you thought it was a format thing), and now it works.
The new variable assignment:
LET vCompareDate = Num(AddMonths(Peek('UptimeDate', -1, 'UptimePerDayTemp'), -1));
The new Load statement:
If (Num(UptimeDate) > $(vCompareDate), 1, 0) as LastMonthFlag
Thanks for your help!