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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

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
July 2025 community update carousel

Fabric Community Update - July 2025

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

July PBI25 Carousel

Power BI Monthly Update - July 2025

Check out the July 2025 Power BI update to learn about new features.

Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.