Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
butterscotch
Helper II
Helper II

Too few arguments were passed to AND function. the minimum argument count for the function is 2

Hello Everyone !
I am quite new to power bi and im facing an issue when im creating new measure , this is my DAX formula 

Completion = IF(AND(VALUES(Master[Start Date].[Date]) <= VALUES(Master[Jan-24]) && VALUES(Master[End Date].[Date]) >= VALUES(Master[Jan-24])), TRUE || FALSE).

the error is Too few arguments were passed to AND function. the minimum argument count for the function is 2

Thank you !
2 ACCEPTED SOLUTIONS
gmsamborn
Super User
Super User

Hi @butterscotch 

 

Is this what you meant?

 

 

Completion = 
IF(
	AND(
		VALUES(Master[Start Date].[Date]) <= VALUES(Master[Jan-24]),
		VALUES(Master[End Date].[Date]) >= VALUES(Master[Jan-24])
	), 
	TRUE,
	FALSE
)

 

 

When using AND(), a comma is used to separate the 2 clauses instead of &&.  It could also be written as:

Completion = 
IF(
	VALUES(Master[Start Date].[Date]) <= VALUES(Master[Jan-24])
		&& VALUES(Master[End Date].[Date]) >= VALUES(Master[Jan-24]),
	TRUE,
	FALSE
)

 

(I didn't try to fix anything else.)

 

View solution in original post

PijushRoy
Super User
Super User

Hi @butterscotch 

Adding to @gmsamborn 
Use simple && in DAX

Completion = 
IF(
		VALUES(Master[Start Date].[Date]) <= VALUES(Master[Jan-24]) &&
		VALUES(Master[End Date].[Date]) >= VALUES(Master[Jan-24]), 
	TRUE,
	FALSE
)

View solution in original post

3 REPLIES 3
butterscotch
Helper II
Helper II

Thank you guys, it helps to resolve the issue by adding VALUES() 

PijushRoy
Super User
Super User

Hi @butterscotch 

Adding to @gmsamborn 
Use simple && in DAX

Completion = 
IF(
		VALUES(Master[Start Date].[Date]) <= VALUES(Master[Jan-24]) &&
		VALUES(Master[End Date].[Date]) >= VALUES(Master[Jan-24]), 
	TRUE,
	FALSE
)
gmsamborn
Super User
Super User

Hi @butterscotch 

 

Is this what you meant?

 

 

Completion = 
IF(
	AND(
		VALUES(Master[Start Date].[Date]) <= VALUES(Master[Jan-24]),
		VALUES(Master[End Date].[Date]) >= VALUES(Master[Jan-24])
	), 
	TRUE,
	FALSE
)

 

 

When using AND(), a comma is used to separate the 2 clauses instead of &&.  It could also be written as:

Completion = 
IF(
	VALUES(Master[Start Date].[Date]) <= VALUES(Master[Jan-24])
		&& VALUES(Master[End Date].[Date]) >= VALUES(Master[Jan-24]),
	TRUE,
	FALSE
)

 

(I didn't try to fix anything else.)

 

Helpful resources

Announcements
LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.