cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
przos Frequent Visitor
Frequent Visitor

1 arguments were passed to a function which expects 3. Query step not working for if statement.

Hi,

We have got a solution where in one of the steps 'if' statement takes a current date and translates it to sprint number. It checks the current date versus what is in the code.
 
The erroneous step is built in the following way:

= if (DateTime.Date(DateTime.LocalNow())<=#date(2018,1,2)) then "Sprint from 2017" else
* lots of conditions for each sprint as the one below.
if (DateTime.Date(DateTime.LocalNow())>=#date("2018,12,19") and DateTime.Date(DateTime.LocalNow())<=#date("2019,1,1")) then "Sprint 51" 
else ""


Until recently, it worked like a charm. However, it does give us a following error message:
Expression.Error: 1 arguments were passed to a function which expects 3.
Details:
    Pattern=
    Arguments=List


Any ideas if Microsoft has changed recently that it these kind of statements do not work anymore? Any ideas how to correct such code to get it working?

Thanks!

1 ACCEPTED SOLUTION

Accepted Solutions
v-jiascu-msft Super Contributor
Super Contributor

Re: 1 arguments were passed to a function which expects 3. Query step not working for if statement.

Hi @przos,

 

The #date("2018,12,19")  should be #date(2018,12,19). The double quotes make the three parameters as one. Please check it and try again.

 

Best Regards,

Dale

Community Support Team _ Dale
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

3 REPLIES 3
przos Frequent Visitor
Frequent Visitor

Power M stepnot working anymore. 1 arguments were passed to a function which expects 3.

Hi,

A while ago my PowerBI query stopped working.

 

One of our mechanism contains solution where new Custom column is being created. It takes current date and then displays Sprint Number (2 weeks range for a sprint). Until recently, this worked all right, but now I get a following message:


Expression.Error: 1 arguments were passed to a function which expects 3.
Details:
    Pattern=
    Arguments=List


The code:
= if (DateTime.Date(DateTime.LocalNow())<=#date(2018,1,2)) then "Sprint from 2017" else
*lots of ifs based like the one below here from S1 to S49

if (DateTime.Date(DateTime.LocalNow())>=#date("2018,12,19") and DateTime.Date(DateTime.LocalNow())<=#date("2019,1,1")) then "Sprint 51" 
else ""

Solution does not pick up the data through/from the gateway and gets it from OFeed. Until this step (Custom Column) all works well. Has Microsoft changed anything here recently?

Anyone could help me with defining what is wrong or how to correct it?

v-jiascu-msft Super Contributor
Super Contributor

Re: 1 arguments were passed to a function which expects 3. Query step not working for if statement.

Hi @przos,

 

The #date("2018,12,19")  should be #date(2018,12,19). The double quotes make the three parameters as one. Please check it and try again.

 

Best Regards,

Dale

Community Support Team _ Dale
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

Highlighted
przos Frequent Visitor
Frequent Visitor

Re: 1 arguments were passed to a function which expects 3. Query step not working for if statement.

Thanks a lot for your help @v-jiascu-msft. It resolved my problem and soluion works as expected. Yey!

Helpful resources

Announcements
Can You Solve These Challenge

Challenge: Can You Solve These?

Find out how to participate in the first Power BI 'Can You Solve These?' challenge.

Community News & Announcements

Community News & Announcements

Get your latest community news and announcements.

Virtual Launch Event

Microsoft Business Applications October Virtual Launch Event

Join us for an in-depth look at the new innovations across Dynamics 365 and the Microsoft Power Platform.

Community Kudopalooza

Win Power BI Swag with Community Kudopalooza!

Each week, complete activities and be qualified in the drawing for cool Power BI Swag.

Users Online
Currently online: 115 members 1,547 guests
Please welcome our newest community members: