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
11 months agoNot applicable
Hi Marija_JC ,
Just wanted to check back were you able to validate the solution for the "X", "Y", and "Z" conditions? If any scenarios are still giving unexpected results, I can walk you through some alternate logic or help troubleshoot further. Let me know.
Regards,
Akhil.