Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
3 years ago
Solved

DATEADD Issue -2 Months

Hi I have a few calculated measures that I am using the DATEADD() function for. I am finding that in a revenue calculation (revenue fact table dated daily) it will not correctly look back -2 from the current month, but it will look back -2 from last month (last full month). Additionally, this same formula will work for a different fact table that is only dated on the first of every month (aka 9/1, 10/1, 11/1), unlike the revenue fact table. Because of this, I suspect that the formula is not taking a full two months look back considering this current month is not complete. I also believe that this is occuring because the formula below will show data, but only about 50% of what should be there. Any ideas as to how I can clear this filter? I've tried ALL('Calendar'[Date]) filter and a few others similar with no luck..

 

Does not work for current month (Nov), but works for Oct look back -> CALCULATE(sum('table'[Total Revenue]),DATEADD('Calendar'[Date], -2, MONTH)
  • Try using PARALLELPERIOD('Date'[Date], -2, MONTH) instead of DATEADD

     
    Pat
     

4 Replies