title: DAX dates between if statement
body: <p>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 "&amp;&amp;" that it returns the dates  - 2 month from last sales date.</p>
  
  <pre><code>"Last 2 periods"; If ([Date]&lt;=LASTDATE(Sales[SalesDate]) 
  &amp;&amp; [Date]&gt; DATE(2019;10;02);1;0);
  </code></pre>
  
  <p>I tried following but this does not work:</p>
  
  <pre><code>"Last 2 periods"; If ([Date]&lt;=LASTDATE(Sales[SalesDate]) 
  &amp;&amp; [Date]&gt; DATEADD(LASTDATE(Sales[SalesDate]);-2;MONTH);1;0);
  </code></pre>
  
  <p>Any suggestions? Or proposals for the best way to create this column in DAX?</p>