title: DAX Previous Month to date total is giving entire previous month's entire total
body: <p>I am using DAX in Power BI to calculate Previous Month sales total to date to create a KPI visual. i.e. if today is 7th Dec then I want to get sales total from 1st Nov to 7th Nov and compare with current month to date.</p>
  
  <pre><code>CurrentMTD = TOTALMTD(SUM(SALES_VOUCHERS[SaleValue]),DatesTable[Date])
  </code></pre>
  
  <p>This works fine.
  However Previous Month YTD gives me total for entire month of November. I have tried the following so far</p>
  
  <pre><code>PMYTD = totalmtd(sum(SALES_VOUCHERS[SaleValue]),dateadd(DATESMTD(DatesTable[Date]),-1,month))
  </code></pre>
  
  <p>and</p>
  
  <pre><code>PMYTD = CALCULATE(sum(SALES_VOUCHERS[SaleValue]),
      DATESBETWEEN(DatesTable[Date],                    
          FIRSTDATE(PREVIOUSMONTH(DatesTable[Date])),   
          LASTDATE(DATEADD(DatesTable[Date],-1,MONTH))))
  </code></pre>
  
  <p>Both return the same answer which is total for the entire previous month .
  If I simply hardcode the start and end date in datesbetween version above, then I do get the desired result. But that is not the solution.</p>
  
  <p>I have linked the fact table (Sales_VOUCHERS) to a DatesTable and as of now there are no other visuals on the report page.
  Kindly assist what I am missing out on and how I can get Previous Month year to date total</p>