Forum Discussion
DateADD Function not returning dates correctly
- 9 years ago
Thanks for your responses! I was able to find the solution to my formula. I was not using the ENDOFMONTH function which was causing the problem. My formula is shown below. It is now working appropriately, and giving me the prior month MTD charges comparable to the date in the current month I am viewing. Eg. Nov 15 MTD charges are now comparable to Oct 15 MTD charges. Keep in mind that this formula only produces charges as of the current month end date. So if you had total charges for the month of September as of 9/30, it would only give you comparable charges as of 8/30 (not for the full month of August). However, if I did have total charges as of 7/31, it would produce for the previous month, total MTD charges as of 6/30.
PrevMTDCharges = TOTALMTD([TotalCharges],DATEADD(ENDOFMONTH('Calendar'[Date]),-1,MONTH))
Thanks for your responses! I was able to find the solution to my formula. I was not using the ENDOFMONTH function which was causing the problem. My formula is shown below. It is now working appropriately, and giving me the prior month MTD charges comparable to the date in the current month I am viewing. Eg. Nov 15 MTD charges are now comparable to Oct 15 MTD charges. Keep in mind that this formula only produces charges as of the current month end date. So if you had total charges for the month of September as of 9/30, it would only give you comparable charges as of 8/30 (not for the full month of August). However, if I did have total charges as of 7/31, it would produce for the previous month, total MTD charges as of 6/30.
PrevMTDCharges = TOTALMTD([TotalCharges],DATEADD(ENDOFMONTH('Calendar'[Date]),-1,MONTH))
Thanks! You solved an issue I was having!