Forum Discussion
Using conditional statement with regex
- 8 years ago
You can use Splitter.SplitTextByAnyDelimiter to split texts on any delimiter with multiple characters (unlike Text.SplitAny).
= Table.AddColumn(#"Lowercased Text", "Category", each if List.Count(Splitter.SplitTextByAnyDelimiter({"marini","zeebra","baker","mcdonalds"})([Description])) > 1 then "food" else null)
You can use Splitter.SplitTextByAnyDelimiter to split texts on any delimiter with multiple characters (unlike Text.SplitAny).
= Table.AddColumn(#"Lowercased Text", "Category", each if List.Count(Splitter.SplitTextByAnyDelimiter({"marini","zeebra","baker","mcdonalds"})([Description])) > 1 then "food" else null)- stretcharm8 years ago
Memorable Member
I've used this solution from KenPuls to do a Vlookup from a list of category keyworks in M in to categorise Packages in my SSIS Dashboard (http://community.powerbi.com/t5/Data-Stories-Gallery/SSIS-Catalog-DB-Dashboard/m-p/244677#M1110)
https://www.excelguru.ca/blog/2015/01/28/creating-a-vlookup-function-in-power-query/
Another option is to use groups however you may need to process the values first if there are lots of changable details such as tran reference.
https://docs.microsoft.com/en-us/power-bi/desktop-grouping-and-binning