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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
o59393
Post Prodigy
Post Prodigy

How to obtain year + 1 of any date

Hi all

 

How can I obtain a date with the following year for any given date using calculated columns?

 

For example if I have a date 4/14/2019, how can I have returned 4/14/2020?

 

Summing 365 to 4/1/4/2019 would be the most obvious thing to do, but this year we had a leap.

 

Thanks.

1 ACCEPTED SOLUTION

Try it wth the DATEADD instead.

 

Next Year Date = DATEADD ( [StartMonth], 1, YEAR )

 

View solution in original post

6 REPLIES 6
v-eachen-msft
Community Support
Community Support

Hi @o59393 ,

 

Do you have a date dimension? You could use CALENDAR() function to create a date dimension and make relationships between this table and fact table. Then you could use DATEADD() to get year+1.

 

Community Support Team _ Eads
If this post helps, then please consider Accept it as the solution to help the other members find it.
jdbuchanan71
Super User
Super User

@o59393 

Try this.

 

Next Year Date = DATE ( YEAR ( [Date] ) +1, MONTH ( [Date] ), DAY ( [Date] ) )

Or this.

Next Year Date = DATEADD ( YourTable[Date], 1, YEAR )

 

Hi @jdbuchanan71 

 

I got this error:

 

#error.JPG

 

How can I solve it? The Start of month is in date format.

 

Thanks.

Does your [StartMonth] column contain a date?

Yeap:

 

sadsasasa.JPG

 

Thanks!

Try it wth the DATEADD instead.

 

Next Year Date = DATEADD ( [StartMonth], 1, YEAR )

 

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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

Top Solution Authors