Forum Discussion

recho's avatar
recho
Copper Contributor
May 14, 2020
Solved

How to create custom column based on multiple conditions in power query

I have a list of conditions that need to be checked in order to populate a new column:   IF [DeviceType] = "ValveSO" AND [Extension] = ".Out" Then [PointTag] OR IF [DeviceType] = "ValveC" AND [Ex...
  • recho 

     

    You should try it like this...

     

    if [DeviceType] = "ValveSO" and [Extension] = ".Out" then [PointTag]
    
    else
    
    if [DeviceType] = "ValveC" and [Extension] = ".Out_CV" then [PointTag]
    
    else
    
    if [DeviceType] = "ValveMO" and [Extension] = ".Out_Open" then [PointTag]
    
    else
    
    if [DeviceType] = null  then [PointTag]
    
    else
    
    null

Resources