Forum Discussion
Custom Column, if then with multiple criteria
afternoon, getting an error message here at the green parenthesis and again at the pink "else"
if [#"Recovery Mechanism "] = "MYRP"
(
if [Actual Commit Gate Date] = null
[#"Capex Estimate ($M)"] - [#"Approved Advanced Funding ($M)"]
else [EAC] - [#"Approved Regulatory Estimate ($M)"]
)
else
(
if [Actual Commit Gate Date] = null
[#"Capex Estimate ($M)"] - [#"Full Funding ($M)"]
else [EAC] - [#"Full Funding ($M)"]
)
help please!
In Power Query?
The form should be:
if ... then .. else
https://learn.microsoft.com/en-us/powerquery-m/expressions-values-and-let-expression#if-expression
--
I always recommend starting from the simplest possible thing that works if writing these statements causes problems, for example,
if [#"Recovery Mechanism "] = "MYRP" then 1 else 0
Make that work, then add in a little bit of complexity then repeat.
1 Reply
- HotChilli
Community Champion
In Power Query?
The form should be:
if ... then .. else
https://learn.microsoft.com/en-us/powerquery-m/expressions-values-and-let-expression#if-expression
--
I always recommend starting from the simplest possible thing that works if writing these statements causes problems, for example,
if [#"Recovery Mechanism "] = "MYRP" then 1 else 0
Make that work, then add in a little bit of complexity then repeat.