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
Anonymous
1 year agoNot applicable
Hi Marija_JC ,
Did you get a chance to try the solution above? Just checking in to see if it worked as expected for your "X", "Y", and "Z" conditions, or if you’ve run into any edge cases where it behaves differently.
Regards,
Akhil.