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
Staregirl
Helper I
Helper I

Using DATEADD with full date table - 1900 to 9999

Hi all

 

I am trying to use DATEADD with my Date table, but my Date table runs from 01/01/1900 to 31/12/1999

 

So I think if I try DATEADD('Date'[Date], -1, YEAR), for example, it returns "An invalid numeric representation of a date value was encountered" because if you take one year away from 1900 you get 1899? Which isn't valid?

 

I feel like MAX and MIN may come into play.

 

Could be something else but I'm trying everything at this point!

 

Thanks!

3 REPLIES 3
amitchandak
Super User
Super User

@Staregirl , Try like

 

Date(year('Date'[Date])-1, month('Date'[Date]), day('Date'[Date]))

 

refer: https://www.youtube.com/watch?v=9qiRivlBv8w

Sorry Amit but this does not answer my question 😞

Staregirl
Helper I
Helper I

Update - I created a VAR that was EDATE([MeasureForMaxDate], -12)

 

That returns 31/01/9998

However, if I add 12 months instead, it throws a 'result is too large or too small' error.

BUT if I do the same with the MIN date, it returns 01/01/1899 - which I thought should throw the same error but I guess it's still a 4 digit 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.