cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Helper V
Helper V

Using Power M to return a value based upon a partial match

I have looked but I don't think this is possible, but hopefully I'm wrong. BTW, I'm making things up here, so ignore any logical issues 🙂

 

 

Ticket IDLong Description
1237Active Directory Failure Node 128
1238NAS Storage Failure
1239Active Directory Truncation Error
1240Memory Failure
1241Add Memory to node 18132

 

The descriptions are generally similar but are verbose. We want to categorize them, right now we are using an if statement where we use Text.Contains for the various categories. If text contains Active Directory we add a new column with Active Director, Memory events, have a value of memory.

 

This "if Text.Contains" statement is difficult to maintain, so I was thinking of having a table with the values and have Power BI deal with it.

 

Search ForReturn
Active DirectoryActive Directory
MemoryMemory
NASStorage
SANStorage

 

I was pretty certain that fuzzy match wasn't the solution, and confirmed it wouldn't work. 

 

I did see the post from https://community.powerbi.com/t5/Desktop/Matching-values-in-one-table-using-wildcards-with-string-va... where they show how to do it in a DAX formula, but I'm trying for this within Power M.

 

Any thoughts are appreciated. Thank you 

1 ACCEPTED SOLUTION
Super User III
Super User III

@TMOCostanzo ,

 

Try this code for a custom column:

let _text = [Long Description] in
Table.SelectRows(Search, each Text.Contains(_text, 
[Search For]))

 

Capture.PNG



Did I answer your question? Mark my post as a solution!

Proud to be a Super User!



View solution in original post

2 REPLIES 2
Helper V
Helper V

Thanks for this.

Using the example code it works perfectly fine.

 

Super User III
Super User III

@TMOCostanzo ,

 

Try this code for a custom column:

let _text = [Long Description] in
Table.SelectRows(Search, each Text.Contains(_text, 
[Search For]))

 

Capture.PNG



Did I answer your question? Mark my post as a solution!

Proud to be a Super User!



View solution in original post

Helpful resources

Announcements
secondImage

Happy New Year from Power BI

This is a must watch for a message from Power BI!

December Update

Check it Out!

Click here to read more about the December 2020 Updates!

Community Blog

Check it Out!

Click here to read the latest blog and learn more about contributing to the Power BI blog!

Get Ready for Power BI Dev Camp

Get Ready for Power BI Dev Camp

Mark your calendars and join us for our next Power BI Dev Camp!.

Top Solution Authors
Top Kudoed Authors