Forum Discussion
chel4782
6 years agoFrequent Visitor
Need help with conditional column
I cannot seem to get the last part of this query Excel =IF([@[PT reporting change]]="after change",[@[PT 2]],IF([@[PT/NPT]]="PT",IF([@activity]="NONOPS",0,[@DURATION]),IF(OR([@operation]="saftey...
- 6 years ago
Here's how your code looks like after playing with it in Powerqueryformatter.com
if [PT Reporting Change] = "AFTER CHANGE" then [PT2] else if ([activity] = "NONOPS" and [#"PT/NPT"] = "PT") then 0 else if ([operation] = "safety" or [operation] = "commute" or [operation] = "lunch") then [DURATION] else ""Your return values can be [PT2], 0, [Duration], or "" . That's not really cool. You want to decide on a column type and then adjust the return values accordingly.
lbendlin
6 years agoSuper User
Here's how your code looks like after playing with it in Powerqueryformatter.com
if [PT Reporting Change] = "AFTER CHANGE" then [PT2]
else if ([activity] = "NONOPS" and [#"PT/NPT"] = "PT") then 0
else if ([operation] = "safety" or [operation] = "commute" or [operation] = "lunch") then [DURATION]
else ""
Your return values can be [PT2], 0, [Duration], or "" . That's not really cool. You want to decide on a column type and then adjust the return values accordingly.