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
Mederic
Post Patron
Post Patron

Alternative to Multiple conditions if then else

Hello everyone,


I have a request that could be made with many conditions that are a bit complicated to manage
I don't know how to solve this kind of case more simply

How can I please handle such a case ?

I hope that with the image, my request is clearer

 

Thank you in advance for your help

Regards

 

Image.jpg

 

POPOSTEDate POClosing DateAmountBenefit
8900027101/10/202221/12/20223412
8900027201/10/202205/01/202078-7
8900028112/11/202228/01/20231204
8900028212/11/202204/02/2023122
8900028312/11/202212/01/2023-36-9
8900028412/11/202216/12/2022-65-15
8900032115/12/202216/12/20226723
8900056113/01/202319/01/202313531
8900056213/01/202328/02/20232411
8900078118/02/202307/03/20237834
8900078218/02/202307/03/2023-15-3
8900078318/02/202312/03/2023447

 

Date POClosing DateAmountBenefitOutput
01/01/202301/03/2023  A
01/01/202301/03/2023100 B
01/01/202301/03/2023100 C
 01/03/2023 0D

 

 

1 ACCEPTED SOLUTION
serpiva64
Solution Sage
Solution Sage

Hi,

with your lookup table i don't know how you get this result "C"??

serpiva64_1-1679438080159.png

 

however this is a possible formulaif [Benefit]<0 and [Closing Date]<#date(2023,03,01) then "D"
else if [Amount]>100 and [Date PO]<#date(2023,01,01) and [Closing Date]<#date(2023,03,01) then "C"
else if [Date PO]<#date(2023,01,01) and [Closing Date]<#date(2023,03,01) and [Amount]>0 and [Amount]<=100 then "B"
else if [Date PO]>#date(2023,01,01) or [Closing Date]>#date(2023,03,01) then "A"
else "Z"

serpiva64_3-1679438307564.png

 

you obtain

serpiva64_2-1679438156536.png

If this post is useful to help you to solve your issue, consider giving the post a thumbs up and accepting it as a solution!

 

View solution in original post

3 REPLIES 3
Mederic
Post Patron
Post Patron

Hello @serpiva64 ,
I have taken your code and adjusted it slightly to my real file.
I'm very happy with the result, and I didn't get any error messages.
Thanks again for your help
Have a nice day

Regards

Mederic
Post Patron
Post Patron

Hello @serpiva64 ,

I'll your code during the day,
Yes, it's more complicated to do that from a matrix table.
I will also look into your question about the "C" result in your screenshot

It's probably wrong what I put

Thanks
Have a nice day

serpiva64
Solution Sage
Solution Sage

Hi,

with your lookup table i don't know how you get this result "C"??

serpiva64_1-1679438080159.png

 

however this is a possible formulaif [Benefit]<0 and [Closing Date]<#date(2023,03,01) then "D"
else if [Amount]>100 and [Date PO]<#date(2023,01,01) and [Closing Date]<#date(2023,03,01) then "C"
else if [Date PO]<#date(2023,01,01) and [Closing Date]<#date(2023,03,01) and [Amount]>0 and [Amount]<=100 then "B"
else if [Date PO]>#date(2023,01,01) or [Closing Date]>#date(2023,03,01) then "A"
else "Z"

serpiva64_3-1679438307564.png

 

you obtain

serpiva64_2-1679438156536.png

If this post is useful to help you to solve your issue, consider giving the post a thumbs up and accepting it as a solution!

 

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.