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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
bbdiver526
Frequent Visitor

IF formula with multiple conditions

I'm relatively new to PowerBI and DAX statements and I'm having an issue with writing an IF statement with multiple conditions.

 

I need to use the Volume if it is current year, type is Actuals and company is ITA.

 

These are the DAX statements I have tried:

_CurrentYearITA = IF(AND('AMER DBP Retail Bookings'[DTF_Current_ITA_YTD] = "Y",'AMER DBP Retail Bookings'[PL_PlanCode] = "ACTUALS",'AMER DBP Retail Bookings'[CO_Company] = "ITA"),'AMER DBP Retail Bookings'[_Volume],0)

This statement says too many arguments for the AND function

 

and

 

_CurrentYearITA = IF('AMER DBP Retail Bookings'[DTF_Current_ITA_YTD] = "Y"||'AMER DBP Retail Bookings'[PL_PlanCode] = "ACTUALS"||'AMER DBP Retail Bookings'[CO_Company] = "ITA";'AMER DBP Retail Bookings'[_Volume];0)

This statement says incorrect syntax starting at the semi-colon after "ITA"

1 ACCEPTED SOLUTION
anandav
Skilled Sharer
Skilled Sharer

@bbdiver526,

AND function can take only 2 parameters.

Check the documentation.

 

You will need to chain the AND operator && to achieve what you want.

e.g.

PowerBI Sample 4.jpg

 

View solution in original post

6 REPLIES 6
Anonymous
Not applicable

The AND function only lets you compare 2 things.  However you can nest further AND statements.  This can be something like 

_CurrentYearITA = IF(
	AND(
		'AMER DBP Retail Bookings'[DTF_Current_ITA_YTD] = "Y",
		AND(
			'AMER DBP Retail Bookings'[PL_PlanCode] = "ACTUALS",
			'AMER DBP Retail Bookings'[CO_Company] = "ITA"
		)
	),
	'AMER DBP Retail Bookings'[_Volume],
	0
)

 

From a best practice perspective, the SWITCH statement is the way to go.

anandav
Skilled Sharer
Skilled Sharer

@bbdiver526,

AND function can take only 2 parameters.

Check the documentation.

 

You will need to chain the AND operator && to achieve what you want.

e.g.

PowerBI Sample 4.jpg

 

anandav,

Thanks for the info. It seems to be working now. I'm not familiar with DAX syntax having just started using it and your response was helpful. I appreciate it.

@bbdiver526,

If it solved your problem could you please mark it as the solution?

SWITCH (
    TRUE (),
    Product[Size] = "XL" && Product[Color] = "Red", "Red and XL",
    Product[Size] = "XL" && Product[Color] = "Blue", "Blue and XL",
    Product[Size] = "L" && Product[Color] = "Green", "Green and L"
)

@dexterz,

Didn't know about using the True() function in SWITCH. Read up on it after I saw your post. Cool!

Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

Check out the November 2025 Power BI update to learn about new features.

Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors