Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Don't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.

Reply
Sannaka
New Member

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?
1 ACCEPTED SOLUTION
Samarth_18
Community Champion
Community Champion

HI @Sannaka ,

 

You can try below code:-

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

Thanks,

Samarth

Best Regards,
Samarth

If this post helps, please consider accepting it as the solution to help the other members find it more quickly.
Appreciate your Kudos!!
Connect on Linkedin

View solution in original post

1 REPLY 1
Samarth_18
Community Champion
Community Champion

HI @Sannaka ,

 

You can try below code:-

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

Thanks,

Samarth

Best Regards,
Samarth

If this post helps, please consider accepting it as the solution to help the other members find it more quickly.
Appreciate your Kudos!!
Connect on Linkedin

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

Jan25PBI_Carousel

Power BI Monthly Update - January 2025

Check out the January 2025 Power BI update to learn about new features in Reporting, Modeling, and Data Connectivity.

Jan NL Carousel

Fabric Community Update - January 2025

Find out what's new and trending in the Fabric community.