cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
PowerBINewbie_1 Regular Visitor
Regular Visitor

Too many arguments were passed to the AND function. The maximum argument count for the function is 2

Hi,

 

Can anyone help. I'm trying to get this formula to run and I keep getting this error message:

 

Too many arguments were passed to the DATESBETWEEN function. The maximum argument count for the function is 3.

 

The formula is:

c_ARGB = IF([ARG A]="",0,
IF([ARG D]="",CALCULATE(SUM(DateTable[WORKDAY]),DATESBETWEEN(DateTable[Date],'IC CMS List'[ARG A],TODAY(),CALCULATE(SUM(DateTable[WORKDAY]),DATESBETWEEN(DateTable[Date],'IC CMS List'[ARG A],'IC CMS List'[ARG D]))))))

 

Thanks!

1 ACCEPTED SOLUTION

Accepted Solutions
Super User
Super User

Re: Too many arguments were passed to the AND function. The maximum argument count for the function

I believe you want:

 

c_ARGB = 
IF(
	[ARG A]="",
	0,
	IF(
		[ARG D]="",
		CALCULATE(
			SUM(DateTable[WORKDAY]),
			DATESBETWEEN(
				DateTable[Date],
				'IC CMS List'[ARG A],
				TODAY()
			)
		),
		CALCULATE(
			SUM(DateTable[WORKDAY]),
			DATESBETWEEN(
				DateTable[Date],
				'IC CMS List'[ARG A],
				'IC CMS List'[ARG D]
			)
		)
	)
)

I have book! Learn Power BI from Packt


Did I answer your question? Mark my post as a solution!

Proud to be a Datanaut!

View solution in original post

4 REPLIES 4
Super User
Super User

Re: Too many arguments were passed to the AND function. The maximum argument count for the function

I believe you want:

 

c_ARGB = 
IF(
	[ARG A]="",
	0,
	IF(
		[ARG D]="",
		CALCULATE(
			SUM(DateTable[WORKDAY]),
			DATESBETWEEN(
				DateTable[Date],
				'IC CMS List'[ARG A],
				TODAY()
			)
		),
		CALCULATE(
			SUM(DateTable[WORKDAY]),
			DATESBETWEEN(
				DateTable[Date],
				'IC CMS List'[ARG A],
				'IC CMS List'[ARG D]
			)
		)
	)
)

I have book! Learn Power BI from Packt


Did I answer your question? Mark my post as a solution!

Proud to be a Datanaut!

View solution in original post

PowerBINewbie_1 Regular Visitor
Regular Visitor

Re: Too many arguments were passed to the AND function. The maximum argument count for the function

OMG Greg, Thank you!!! I've been banging my head against a wall regarding this solution for a month now. 

 

I noticed that in my original formula everything was on the same line. However, I cannot find out where to go so that I can enter the forumla on separate lines. The area that I insert my formulas doesn't allow me to enter formulas on seperate lines.

 

As a result, I tried to modify my formula to match yours but still on one line and I still got an error message. 

 

What was I doing wrong? and where can I go to practice so that I can get better? 

 

Super User
Super User

Re: Too many arguments were passed to the AND function. The maximum argument count for the function

Alt-Enter is your friend. That sends you to a new line within the DAX editing window. Or you can just copy and paste my formula.


I have book! Learn Power BI from Packt


Did I answer your question? Mark my post as a solution!

Proud to be a Datanaut!

PowerBINewbie_1 Regular Visitor
Regular Visitor

Re: Too many arguments were passed to the AND function. The maximum argument count for the function

Thanks. I utilized the copy and paste keyboard shortcut and copied your solution. I'm still amazed. Again thanks.

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: 308 members 2,981 guests
Please welcome our newest community members: