That seems to work, but I'd like to understand why.
Why does the documentation specify that N (the 1st parameter) must be (1), 2, (3), 4 or 6, and why are 1 and 3 in parentheses? Why is that a must? If it defines the range size in months, why can't I set N to any arbitrary number of months?
What is the purpose of basedate, if the first_month_of_year has to be defined as well? What has January 1st to do with this function anyway? The definition of this function is very unclear.
I am rarely using InMonths() function, if ever.
I assume it's just a more generalized function that may be used instead of InMonth() (if used 1 as first argument) and InQuarter() (if used 3 as first argument).
Instead of above expression, you can also use:
if(MyDate >= MonthStart(now(),-3) and MyDate <=monthend(now(),-1),1,0) as 'Prior 3 months',
which I found much easier to read and understand. And even much more flexible to adapt to e.g. periods like last 15 months.