Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!

Reply
Anonymous
Not applicable

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
camargos88
Community Champion
Community Champion

@Anonymous ,

 

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
Anonymous
Not applicable

Thanks for this.

Using the example code it works perfectly fine.

 

camargos88
Community Champion
Community Champion

@Anonymous ,

 

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!



Helpful resources

Announcements
April AMA free

Microsoft Fabric AMA Livestream

Join us Tuesday, April 09, 9:00 – 10:00 AM PST for a live, expert-led Q&A session on all things Microsoft Fabric!

March Fabric Community Update

Fabric Community Update - March 2024

Find out what's new and trending in the Fabric Community.