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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
mechanix85
Helper I
Helper I

help with a custom function

Hello, how to simplify the function if the query? (Table.AddColumn) too lazy to write up to 20 function attachments if

 

 

let
    Souce= {"power querry","poweer query","pooower que1ry"},
    #"Table.FromList" = Table.FromList(Souce, Splitter.SplitByNothing(), null, null, ExtraValues.Error),


    #"Table.AddColumn" = Table.AddColumn(Table.FromList, "Group", each if Text.Contains([Column1],"power") then "power" else
if Text.Contains([Column1],"query") then "query" else
null)



in
    #"Table.AddColumn"

 

1 ACCEPTED SOLUTION
ImkeF
Community Champion
Community Champion

Seems that you're looking for a partial-match-lookup, where you can put your search-values in a table. Please check this post:

https://community.powerbi.com/t5/Desktop/joinAlgorithm-and-keyEqualityComparers/m-p/182148#M79842

 

Imke Feldmann

www.TheBIccountant.com -- How to integrate M-code into your solution  -- Check out more PBI- learning resources here

 

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

View solution in original post

3 REPLIES 3
ImkeF
Community Champion
Community Champion

Seems that you're looking for a partial-match-lookup, where you can put your search-values in a table. Please check this post:

https://community.powerbi.com/t5/Desktop/joinAlgorithm-and-keyEqualityComparers/m-p/182148#M79842

 

Imke Feldmann

www.TheBIccountant.com -- How to integrate M-code into your solution  -- Check out more PBI- learning resources here

 

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

@ImkeF, cool! Thank youSmiley Happy

It works, but it's very slow for my table (100,000 lines of the Product Reference), taking into account the links. Are there any other options?

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.