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.
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
Solved! Go to 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
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 .
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
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
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
107 | |
97 | |
75 | |
65 | |
53 |
User | Count |
---|---|
144 | |
103 | |
98 | |
85 | |
64 |