Forum Discussion

EZimmet's avatar
EZimmet
Resolver I
4 years ago
Solved

Nested If

Trying to do a nested if have issue if someone can please assist - TY 

 

Any of conditions to the left need to populate a 3rd column tagged to be reviewed

 

 

 

 

 

 

 

 

 

= Table.AddColumn(#"Expanded EZ Nodes", "Tab_Review_Live", each

 

if (OR
[DeviceStatus] = "Disposed", "Inventory", "Missing", "Return to Client"
and
[DisplayLabel] = "Live",
"Review Live",


if (OR [DeviceStatus] = "Active", "Inventory", "No Power"
and
[DisplayLabel] = "Disposed Devices",
"Review Disposed",


if ([DeviceStatus] = "Disposed"
and
[DisplayLabel] = "Old Devices",
"Review Old", null)))))

 

 

 

 

  • The syntax is a bit off. Try adjusting it like this:

    if List.Contains({"Disposed", "Inventory", "Missing", "Return to Client"}, [DeviceStatus]) and [DisplayLabel] = "Live"
    then "Review Live"
    else if List.Contains({"Active", "Inventory", "No Power"}, [DeviceStatus]) and [DisplayLabel] = "Disposed Devices"
    then "Review Disposed"
    else if [DeviceStatus] = "Disposed" and [DisplayLabel] = "Old Devices"
    then "Review Old"
    else null

2 Replies

  • The syntax is a bit off. Try adjusting it like this:

    if List.Contains({"Disposed", "Inventory", "Missing", "Return to Client"}, [DeviceStatus]) and [DisplayLabel] = "Live"
    then "Review Live"
    else if List.Contains({"Active", "Inventory", "No Power"}, [DeviceStatus]) and [DisplayLabel] = "Disposed Devices"
    then "Review Disposed"
    else if [DeviceStatus] = "Disposed" and [DisplayLabel] = "Old Devices"
    then "Review Old"
    else null
    • EZimmet's avatar
      EZimmet
      Resolver I

      Thank you Sir 

      This worked all i needed to do is add last   )