Forum Discussion
recho
May 14, 2020Copper Contributor
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...
- May 15, 2020
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
Subodh_Tiwari_sktneer
May 15, 2020Silver Contributor
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
recho
May 15, 2020Copper Contributor
Thanks Subodh, that worked!
- Subodh_Tiwari_sktneerMay 15, 2020Silver Contributor
You're welcome! Glad it worked as desired.