Forum Discussion
JimB-GA
Helper III
6 years agoreturning a value if substring is found
Good afternoon all, I have a table containing a field called 'Description', and a field called 'Amount'. I would like to create a field that displays the amount if the description field contains...
- 6 years ago
Hi JimB-GA
There's a very simple way to do it.
You can add a conditional column in edit query.
Corresponding M query:= Table.AddColumn(#"Promoted Headers", "Custom", each if Text.Contains([Description], "dividend") then [Amount] else [Description])Best Regards,
Liang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
V-lianl-msft
Community Support
6 years agoHi JimB-GA
There's a very simple way to do it.
You can add a conditional column in edit query.
Corresponding M query:
= Table.AddColumn(#"Promoted Headers", "Custom", each if Text.Contains([Description], "dividend") then [Amount] else [Description])
Best Regards,
Liang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
- JimB-GA6 years ago
Helper III
Thanks. A quick and easy solution.
Jim