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
cronline
Regular Visitor

Error relating to the DATE Function when creating a Date table - Too Few Arguments Passed

Hi,

 

I am trying to create a Date Table and in creating a Date column, I have come across an unexpected error to do with the DATE Function. The DAX I am using, after clicking on the "Add Table" button, is "DateKey = CALENDAR(DATE(2012,01,01),DATE(2017,06,30))" and the error is: "Too few arguments were passed to the DATE function. The minimum argument count for the function is 3."

 

I have tried variations of the numbers such as "2012,1,1" and get the same error. What is also strange that after typing in the Year and the comma, the Intellisense does not move to "Month".

 

date-error.PNG

 

Any assistance would be appreciated.

 

Thanks

Chris

1 ACCEPTED SOLUTION

OK, I have got this working now and the solution is as Bizarre as the initial problem. Below is the DAX syntax that worked.

 

DateTable = CALENDAR(DATE(2015 ,01 ,01),DATE(2016 , 01 , 01) )

 

What's different? I hear you ask, well, before the comma delimiter between there is a space, so, "2015 ," instead of "2015,". Same for the Month.

 

If anyone could explain this, I would love to know the reason this is happening.

 

Thanks

Chris

View solution in original post

7 REPLIES 7
stevediaz
New Member

The error "Too few arguments were passed to the DATE function" occurs when you are not providing the required three arguments (year, month, day) for the DATE function in your DAX expression. Double-check your syntax and ensure that you are passing the arguments correctly. You can also consult the documentation or community forums for your specific development environment for further assistance.

 

Thank you .

Anonymous
Not applicable

Chris,

I copy-pasted your DAX into PBi Desktop and it worked just fine for me.  Special character somewhere?!

Hi Steve,
Thanks for checking it, yes, definitely no special characters, it's exactly as it is in that screenshot, it's the most bizarre and frustrating issue. I don't know if it's got something to do with my local machine date and time settings or Culture, but it must be something other than syntax as the DAX is definitely correct.

Thanks

Chris

OK, I have got this working now and the solution is as Bizarre as the initial problem. Below is the DAX syntax that worked.

 

DateTable = CALENDAR(DATE(2015 ,01 ,01),DATE(2016 , 01 , 01) )

 

What's different? I hear you ask, well, before the comma delimiter between there is a space, so, "2015 ," instead of "2015,". Same for the Month.

 

If anyone could explain this, I would love to know the reason this is happening.

 

Thanks

Chris

Anonymous
Not applicable

I ran into the same issue.

An other way to work around this is by enclosing all values in ()

 

DATE((2016),(1),(1))

 

I think it has something to do with regional settings causing the comma to be interpreted as a decimal sign.

Goodness, two years later and I'm finding the same issue. 

 

DateTable = CALENDAR(DATE(2015 ,01 ,01),DATE(2016 , 01 , 01) ) ... this works
DateTable = CALENDAR(DATE(2015,01 ,01),DATE(2016 , 01 , 01) )  ... this gives me the above error

Anonymous
Not applicable

That's weird.

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