Forum Discussion
Error retuned
- 1 year ago
I think Your formula has a couple of issues:
The condition for "Orange" (Today > [#"Work Order Received - Target"]) is placed after checking if Actual <= Target, which means it never gets evaluated.
There is an extra space in [#"Work Order Received - Target "], which can cause errors.
The sequence of conditions should be logically ordered to ensure each case is properly checked.Corrected M:
= Table.AddColumn(#"Added Conditional Column31", "Work Order Color Final", each if [#"Work Order Received - Actual"] > [#"Work Order Received - Target"] then "Red" else if [#"Work Order Received - Actual"] <= [#"Work Order Received - Target"] then "#00563B" else if Date.From(DateTime.LocalNow()) > [#"Work Order Received - Target"] then "Orange" else if [#"Work Order Received - Target"] <= [#"Work Order Received - Projected"] then "#50C878" else null )Fixes & Improvements:
- Ensured "Orange" condition is properly evaluated before checking if Target is <= Projected.
- Used Date.From(DateTime.LocalNow()) to get today's date in Power Query.
- Removed extra space in [#"Work Order Received - Target "].
Now, this should return:
- "Red" if Actual is after Target
- "#00563B" if Actual is before or equal to Target
- "Orange" if Today is after Target
- "#50C878" if Target is equal to or before Projected
- null otherwise.
Hi LAN1984
I wanted to follow up since I haven't heard from you in a while. Have you had a chance to try the suggested solutions?
If your issue is resolved, please consider marking the post as solved. However, if you're still facing challenges, feel free to share the details, and we'll be happy to assist you further.
Looking forward to your response!
If the above information is helpful, please give us Kudos and mark the response as Accepted as solution.
Best Regards,
Community Support Team _ C Srikanth.