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
HamzaAhmad
New Member

Putting more than one condition in IF statement

Hello,

I have this table which is displaying the material count "Balance" and green and red indicators indicate if the material balance is 0 (via a red circular indicator) or more than 0 (via a green circular indicator). I want to include an amber indicator too if the material balance gets to 5. Is this possible in Power BI?

 

Also, when any of the indicators are orange or red, the top indicator should become red or orange. If all is green, it should remain green. Please help me and I greatly appreciate your help.

 

question SS2.png

 

Thanks.

1 ACCEPTED SOLUTION

I think I am really close. I can get the green and red indicator but it is not turning amber if the materials become less than 5 but greater than 0, instead it turns green.

 

This is my formula:

 

Close = IF(CONTAINS(Material,Material[Balance],0),"https://image.ibb.co/mVYPcm/rsz_1redindicator.png",IF(CONTAINS(Material,Material[Balance],5,Material[Balance],4,Material[Balance],3,Material[Balance],2,Material[Balance],1),"https://image.ibb.co/c0LRq6/rsz_orangeindicator.png","https://image.ibb.co/kLLRq6/rsz_greenindicator.png"))

Please advise what am I missing here.

 

I solved the first problem by using SWITCH. Formula below:

 

Indicator = SWITCH([Balance],0,"https://image.ibb.co/mVYPcm/rsz_1redindicator.png",5,"https://image.ibb.co/c0LRq6/rsz_orangeindicator.png",4,"https://image.ibb.co/c0LRq6/rsz_orangeindicator.png",3,"https://image.ibb.co/c0LRq6/rsz_orangeindicator.png",2,"https://image.ibb.co/c0LRq6/rsz_orangeindicator.png",1,"https://image.ibb.co/c0LRq6/rsz_orangeindicator.png","https://image.ibb.co/kLLRq6/rsz_greenindicator.png")

View solution in original post

2 REPLIES 2
HamzaAhmad
New Member

Solved the second problem by this formula

 

Column = IF(CONTAINS(Material,Material[Balance],0),"https://image.ibb.co/mVYPcm/rsz_1redindicator.png","https://image.ibb.co/kLLRq6/rsz_greenindicator.png")

 

However, the first problem remains, how to put more than one condition in the IF statement. Something like ELSE IF in PHP.

 

Thanks for your help

I think I am really close. I can get the green and red indicator but it is not turning amber if the materials become less than 5 but greater than 0, instead it turns green.

 

This is my formula:

 

Close = IF(CONTAINS(Material,Material[Balance],0),"https://image.ibb.co/mVYPcm/rsz_1redindicator.png",IF(CONTAINS(Material,Material[Balance],5,Material[Balance],4,Material[Balance],3,Material[Balance],2,Material[Balance],1),"https://image.ibb.co/c0LRq6/rsz_orangeindicator.png","https://image.ibb.co/kLLRq6/rsz_greenindicator.png"))

Please advise what am I missing here.

 

I solved the first problem by using SWITCH. Formula below:

 

Indicator = SWITCH([Balance],0,"https://image.ibb.co/mVYPcm/rsz_1redindicator.png",5,"https://image.ibb.co/c0LRq6/rsz_orangeindicator.png",4,"https://image.ibb.co/c0LRq6/rsz_orangeindicator.png",3,"https://image.ibb.co/c0LRq6/rsz_orangeindicator.png",2,"https://image.ibb.co/c0LRq6/rsz_orangeindicator.png",1,"https://image.ibb.co/c0LRq6/rsz_orangeindicator.png","https://image.ibb.co/kLLRq6/rsz_greenindicator.png")

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