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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
ThomasWeppler
Skilled Sharer
Skilled Sharer

How to add two years to today

Hi Power BI community

I want to add 2 years to today in DAX.
My Dax is like this
Two years in the future = Today() + 730

 

My problem is that this DAX doesn't respect leap years.
Is there someway to change the DAX so it adds years instead of days?

All help is appriciated


1 ACCEPTED SOLUTION
AndrewPF
Helper V
Helper V

Use the DATEADD function: 

New Date = DATEADD('Table Name'[Old Date], +2 year)

see also: 

https://dax.guide/dateadd/

View solution in original post

3 REPLIES 3
Iden
Frequent Visitor

I did this

DateTable =
CALENDAR(DATE(2020, 1, 1), DATE(YEAR(TODAY())+2,12,31))
AndrewPF
Helper V
Helper V

Use the DATEADD function: 

New Date = DATEADD('Table Name'[Old Date], +2 year)

see also: 

https://dax.guide/dateadd/

Thanks for the solution.

Helpful resources

Announcements
LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.