Forum Discussion
strdst2090
1 year agoFrequent Visitor
Multiple IF Conditions
I have a large dataset (about 300,000 records), and I have to build a custom column based on one of the columns in the dataset. The custom column is basically an 'IF-ELSE' condition, however I have t...
- 1 year ago
Even better would be to add some exception handling: Return all replacement values found, (separated by commas) and an empty string if no conditions are found:
= Text.Combine(Table.SelectRows(ReplaceConditions, (current_row) => Text.Contains([Line Description], current_row[SearchText]))[ReplaceText],",")
PwerQueryKees
1 year agoSuper User
I would create a separate table named ReplaceConditions with 2 columns SearchText and ReplaceText
Your add column formula would be something like
= Table.SelectRows(ReplaceConditions, (current_row) => Text.Contains([Line Description], current_row[SearchText])[ReplaceText]{0})
Haven't tested it.... If you have trouble implementing it, I can provide more help.