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
djbc1986
Frequent Visitor

Possible error on Date Dax Function Definition

Hi there

 

In theory, in this definition, I should be getting an error with a negative value for the year. However, what I'm seeing is the minimum year (1900) minus the negative parameter.

 

For values greater than 9999 or less than zero (negative values), the function returns a #VALUE! error.

Capture.JPG

Am Idoing something wrong or misunderstanding something?

Regards

1 ACCEPTED SOLUTION
az38
Community Champion
Community Champion

Hi @djbc1986 

I think it works correct

so, zero date is 1900, minus 1 is 1899 and it is ok, it could be useful forsome historical data

 

Plus 1 year to 9999 has the other widely-known 10000 year problem, you could read for example here https://en.wikipedia.org/wiki/Year_10,000_problem 

 

also, SQL datetime range is up to 9999 https://docs.microsoft.com/en-us/sql/t-sql/data-types/datetime-transact-sql?view=sql-server-ver15 

 

 

do not hesitate to give a kudo to useful posts and mark solutions as solution


do not hesitate to give a kudo to useful posts and mark solutions as solution
LinkedIn

View solution in original post

3 REPLIES 3
az38
Community Champion
Community Champion

Hi @djbc1986 

I think it works correct

so, zero date is 1900, minus 1 is 1899 and it is ok, it could be useful forsome historical data

 

Plus 1 year to 9999 has the other widely-known 10000 year problem, you could read for example here https://en.wikipedia.org/wiki/Year_10,000_problem 

 

also, SQL datetime range is up to 9999 https://docs.microsoft.com/en-us/sql/t-sql/data-types/datetime-transact-sql?view=sql-server-ver15 

 

 

do not hesitate to give a kudo to useful posts and mark solutions as solution


do not hesitate to give a kudo to useful posts and mark solutions as solution
LinkedIn
djbc1986
Frequent Visitor

Hi @az38 

It works, no problem with that. The definition of the function is the one that is not correct:

 

definition.JPG

 

This is what I mean.

 

Regards.

az38
Community Champion
Community Champion

@djbc1986 

unfortunately, MSDN is not the best and not the completely correct and full DAX documentation source.

even microsoft people refers to https://dax.guide/date/  , but there is no mention about function behaviour outside the 0-9999 range, only here https://dax.guide/dt/datetime/ 

The first date officially supported by DAX is March 1, 1900. Date calculations executed on time periods prior to that date might lead to errors and should be considered as inaccurate.

do not hesitate to give a kudo to useful posts and mark solutions as solution


do not hesitate to give a kudo to useful posts and mark solutions as solution
LinkedIn

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