Forum Discussion
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".
Any assistance would be appreciated.
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
7 Replies
- AnonymousNot applicable
Chris,
I copy-pasted your DAX into PBi Desktop and it worked just fine for me. Special character somewhere?!
- cronlineRegular Visitor
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
- cronlineRegular Visitor
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
- stevediazNew 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 .