10 Replies Latest reply on Jan 18, 2019 12:51 PM by Hari Ankem

    This Month vs Last Month

    Randy Kirschner

      Hello forum.


      I'm having trouble figuring out the formula to show me last months sales numbers and after searching through the forums and trying different formulas I don't seem to be understanding what needs to be done. Partially because I don't seem to fully understand what the date functions are trying to accomplish.


      I put together a sample workbook so you can see what I'm trying to do. I just want to show the current month sales and next to it show last months sales. What I did was create a Last Month value:


      date(dateadd('month',-1,[Calendar Month]))


      Then I created a formula to try and get the last months data:


      if datetrunc('month',[Calendar Month]) = datetrunc('month',[Last Month])

      then [Sales]



      But that's not working. It's just showing me the same months value. Can someone help me figure out what I'm doing wrong?