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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
Stymied9
Frequent Visitor

IF / AND / OR statements

This is the Excel version of the formula I am using which is not working:

=IF(OR(V3>19958*0.85,AND(Y3="20FT_COFC",AF3>33*0.85),AND(Y3="40FT_COFC",AF3>67*0.85),AND(Y3="40FT_HC",AF3>76*0.85)),"","Not ")&"Optimized"



 Attached/Below is an excerpt of the data set:



 Basically this is what I am trying to do:

Argument 1
If the column V (Total Weight) is greater than 85% of 19958, I want the column to indicate "Optimized".

Argument 2
If Column Y (Equipment Type) = 20FT_COFC and column AF is greater than 85% of 33, I want the column to indicate "Optimized"

Argument 3
If Column Y (Equipment Type) = 40FT_COFC and column AF is greater than 85% of 67, I want the column to indicate "Optimized"

Argument 4
If Column Y (Equipment Type) = 40FT_HC and column AF is greater than 85% of 76, I want the column to indicate "Optimized"

If none of those 4 arguments are true, then I want the column to indicate "Not Optimized"

I hope that makes sense. Thanks !Capture.PNG

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Would something like this work?

ResultColumn = IF(
	[Total Master Wgt] > (19958 * 0.85),
	"Optimized",
	SWITCH(
		[Equipment Type],
		"20FT_COFC", IF([CBM] > (33 * 0.85), "Optimized", "Not Optimized"),
		"40FT_COFC", IF([CBM] > (67 * 0.85), "Optimized", "Not Optimized"),
		"40FT_HC", IF([CBM] > (76 * 0.85), "Optimized", "Not Optimized"),
		"Not Optimized"
	)
)


You'll need to check your field names, i've done this based on your screenshot.

 

View solution in original post

2 REPLIES 2
Anonymous
Not applicable

Would something like this work?

ResultColumn = IF(
	[Total Master Wgt] > (19958 * 0.85),
	"Optimized",
	SWITCH(
		[Equipment Type],
		"20FT_COFC", IF([CBM] > (33 * 0.85), "Optimized", "Not Optimized"),
		"40FT_COFC", IF([CBM] > (67 * 0.85), "Optimized", "Not Optimized"),
		"40FT_HC", IF([CBM] > (76 * 0.85), "Optimized", "Not Optimized"),
		"Not Optimized"
	)
)


You'll need to check your field names, i've done this based on your screenshot.

 

That DID work Ross !  Thank you very much!

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

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.