Power Query - Text.Contain issue when categorizing

Viewed 42

I have a question on Power Query in Excel (I believe it’s the same as PowerBI) and I find your videos clear and very helpful. However, I’ve been struggling with Text.Contains

Based on the explanation, it finds the substrings to match. However, this has caused my report to be very inaccurate as some substrings are found in words outside my keywords table.

For example, I have a main table below:-

Short Description Category Unable to login to tpx. Thank you for your assistance

In order to find the Category, I will run power query with the table below:-

Category Keyword Agency App TPX Agency App STAN

In my query, I will add a custom conditional column whereby

= Table.AddColumn(#"Expanded Custom", "Custom", each if Text.Contains([Short Description], [Keyword], Comparer.OrdinalIgnoreCase) then [Keyword] else null)

As in the short description, it contains both the word “tpx” and the word “stan” (in the word “assistance”), it resulted in both appearing as the Application Name

QueryOutput

As “STAN” is a separate application, I would not like it to appear in this scenario.

Is there a way to get around this?

0 Answers
Related