Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!Vote for your favorite vizzies from the Power BI Dataviz World Championship submissions. Vote now!
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",[@operation]="commute",[@operation]="lunch"),[@DURATION],0)))
Power Bi-Power Query
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 ""
Solved! Go to Solution.
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.
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.
Vote for your favorite vizzies from the Power BI World Championship submissions!
If you love stickers, then you will definitely want to check out our Community Sticker Challenge!
Check out the January 2026 Power BI update to learn about new features.
| User | Count |
|---|---|
| 11 | |
| 10 | |
| 6 | |
| 6 | |
| 5 |