The ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM.
Get registeredCompete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.
Hi - I am trying to add a custom column which search each row in a column for multiple substrings which are contained in a second table. Ie if the substring "red" is contained in "XredX', then populate a new column with "color"
Currently I have to add each value to search for manually, eg
= Table.AddColumn(#"Table", "Result", each if Text.Contains([TextToSearch], "red", Comparer.OrdinalIgnoreCase) then "color"
else if Text.Contains([TextToSearch], "blue", Comparer.OrdinalIgnoreCase) then "color"
else null )
but I'm hoping there's a way to add reference to a dynamic List which isn't in the same table and have the Text.Contains function loop through these.
eg
= Table.AddColumn(#"Table", "Result", each if Text.Contains([TextToSearch], [LookupList], Comparer.OrdinalIgnoreCase) then [LookupResult]
else null )
Any help is much appreciated.
Solved! Go to Solution.
Please check this out: https://community.powerbi.com/t5/Desktop/joinAlgorithm-and-keyEqualityComparers/m-p/182148#M79842
Imke Feldmann (The BIccountant)
If you liked my solution, please give it a thumbs up. And if I did answer your question, please mark this post as a solution. Thanks!
How to integrate M-code into your solution -- How to get your questions answered quickly -- How to provide sample data -- Check out more PBI- learning resources here -- Performance Tipps for M-queries
You may also try SEARCH Function in DAX.
Please check this out: https://community.powerbi.com/t5/Desktop/joinAlgorithm-and-keyEqualityComparers/m-p/182148#M79842
Imke Feldmann (The BIccountant)
If you liked my solution, please give it a thumbs up. And if I did answer your question, please mark this post as a solution. Thanks!
How to integrate M-code into your solution -- How to get your questions answered quickly -- How to provide sample data -- Check out more PBI- learning resources here -- Performance Tipps for M-queries
Thanks ImkeF, this is exactly what I was after.