Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.
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
PO | POSTE | Date PO | Closing Date | Amount | Benefit |
8900027 | 1 | 01/10/2022 | 21/12/2022 | 34 | 12 |
8900027 | 2 | 01/10/2022 | 05/01/2020 | 78 | -7 |
8900028 | 1 | 12/11/2022 | 28/01/2023 | 120 | 4 |
8900028 | 2 | 12/11/2022 | 04/02/2023 | 12 | 2 |
8900028 | 3 | 12/11/2022 | 12/01/2023 | -36 | -9 |
8900028 | 4 | 12/11/2022 | 16/12/2022 | -65 | -15 |
8900032 | 1 | 15/12/2022 | 16/12/2022 | 67 | 23 |
8900056 | 1 | 13/01/2023 | 19/01/2023 | 135 | 31 |
8900056 | 2 | 13/01/2023 | 28/02/2023 | 24 | 11 |
8900078 | 1 | 18/02/2023 | 07/03/2023 | 78 | 34 |
8900078 | 2 | 18/02/2023 | 07/03/2023 | -15 | -3 |
8900078 | 3 | 18/02/2023 | 12/03/2023 | 44 | 7 |
Date PO | Closing Date | Amount | Benefit | Output |
01/01/2023 | 01/03/2023 | A | ||
01/01/2023 | 01/03/2023 | 100 | B | |
01/01/2023 | 01/03/2023 | 100 | C | |
01/03/2023 | 0 | D |
Solved! Go to Solution.
Hi,
with your lookup table i don't know how you get this result "C"??
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"
you obtain
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!
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
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
Hi,
with your lookup table i don't know how you get this result "C"??
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"
you obtain
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!
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.