Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

How to add a year in a calculated column?

DateTable=CALENDARAUTO()

Calculated columns:

NextYearDate = DATEADD(DateTable[Date],1,YEAR)

The above calculated column shows blanks instead of the next years date. Why is that and how to fix it?

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

>Solution :

DATEADD is a Time Intelligence function, which returns dates from your date column shifted by the specified interval. This means that for the latest year in your date table, there are no "next year" values to return.

An alternative would be:

NextYearDate = 
    DATE ( 
        YEAR ( DateTable[Date] ) + 1,
        MONTH ( DateTable[Date] ),
        DAY ( DateTable[Date] )
    )
Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading