cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
cronline Frequent Visitor
Frequent 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

Accepted Solutions
cronline Frequent Visitor
Frequent Visitor

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

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

6 REPLIES 6
Steve_Wheeler Established Member
Established Member

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

Chris,

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

cronline Frequent Visitor
Frequent Visitor

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

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

cronline Frequent Visitor
Frequent Visitor

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

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

Steve_Wheeler Established Member
Established Member

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

That's weird.
Bienze Frequent Visitor
Frequent Visitor

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

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.

michellepace Regular Visitor
Regular Visitor

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

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

Helpful resources

Announcements
October 2019 Community Highlights

October 2019 Community Highlights

October was a busy month in the community. Read the recap article to learn about some of the events and content.

New Badges

Incoming: New and Improved Badges

Exciting news: We've given our badges an overhaul and added brand news ones.

Ask Amir Anything

Exclusive LIVE Community Event No. 2 – Ask Amir Anything

Next in our Triple A series: Ask Amir Netz questions about the latest updates, features and future.

Analytics in Azure virtual event

Analytics in Azure virtual event

Experience a limitless analytics service built to ingest, prep, manage, and serve data for immediate use in Power BI.

Users Online
Currently online: 342 members 3,475 guests
Please welcome our newest community members: