Power BI is turning 10! Tune in for a special live episode on July 24 with behind-the-scenes stories, product evolution highlights, and a sneak peek at what’s in store for the future.
Save the dateEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.
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
User | Count |
---|---|
77 | |
76 | |
41 | |
29 | |
24 |
User | Count |
---|---|
96 | |
91 | |
52 | |
47 | |
46 |