Forum Discussion

rayinOz's avatar
rayinOz
Icon for Helper III rankHelper III
7 years ago
Solved

Calculate Date based on existing Date column

Hello PowerBI users

 

I have a date column and I want to create a new column based on that date. The new date (in the new column) would be minus 25 months from the existing column.

 

Thoughts?

 

Kind regards

Ray

  • Hi rayinOz ,

     

    To use dateadd function, we should create a calendar table in advance and create relationship between tables.

     

    calendar = CALENDAR(DATE(2016,01,01),DATE(2019,12,31))
    Column = DATEADD('calendar'[Date],-25,MONTH)

    To use EDATE as Ashish_Mathur metioned, we can get the excepted result without calendar table.

    pre = EDATE('Table'[date],-25)

     

4 Replies