Forum Discussion
Marija_JC
1 year agoNew Member
Help with M code conditional column
Hello, I woluld like to create an coditional column based on the text values from another column. So, it should be like: if column B has value " x", then text in column A sholud start from 4th cha...
- 1 year ago
use the following formula
= if [ColumnB] = "x" then Text.Middle([ColumnA], 3) else if [ColumnB] = "y" then Text.BeforeDelimiter([ColumnA], "-") else if [ColumnB] = "z" then Text.BetweenDelimiters([ColumnA], "(", ")") else null
Omid_Motamedise
1 year agoSuper User
use the following formula
=
if [ColumnB] = "x" then
Text.Middle([ColumnA], 3)
else if [ColumnB] = "y" then
Text.BeforeDelimiter([ColumnA], "-")
else if [ColumnB] = "z" then
Text.BetweenDelimiters([ColumnA], "(", ")")
else
null