I'm new in dax and trying to create a calculated column in a calendar table for which I want values to be returned in a new column 1 or 0 based if the CalendarDate is in the period. I tried the following which returns the correct values but I need to change after "&&" that it returns the dates - 2 month from last sales date.
"Last 2 periods"; If ([Date]<=LASTDATE(Sales[SalesDate])
&& [Date]> DATE(2019;10;02);1;0);
I tried following but this does not work:
"Last 2 periods"; If ([Date]<=LASTDATE(Sales[SalesDate])
&& [Date]> DATEADD(LASTDATE(Sales[SalesDate]);-2;MONTH);1;0);
Any suggestions? Or proposals for the best way to create this column in DAX?