Forum Discussion

Sannaka's avatar
Sannaka
New Member
4 years ago
Solved

Calendar -table, date x months before today

I want to create a new column to my Calendar table that shows the date four months before today. This is the formula I've used:

4 months history = DATE( YEAR( Calendar[Date] ), MONTH( Calendar[Date] ) -4, DAY( Calendar[Date] )). 

At first everything seems to work fine and the right date is implemented, but when I try to save the file, something weird happens and the formula automaticly changes to the form 
4 months history = DATE( YEAR( Calendar[Date] ), MONTH( Calendar[Date] ) -4. DAY( Calendar[Date] )) 
which obviously does not work, because the comma, that used to be there, has changed to full stop.

Does anyone has a glue what is happening and why? Or does someone have a suggestion how I could get the same result with some another formula?
  • HI Sannaka ,

     

    You can try below code:-

    4 months history =
    DATEADD ( Calendar[Date], -4, MONTH )

    Thanks,

    Samarth

1 Reply

  • Samarth_18's avatar
    Samarth_18
    Icon for Community Champion rankCommunity Champion

    HI Sannaka ,

     

    You can try below code:-

    4 months history =
    DATEADD ( Calendar[Date], -4, MONTH )

    Thanks,

    Samarth