Forum Discussion
matt_rac
1 year agoRegular Visitor
How to extract data from a column based on another column?
How can I use M in power query to extract data from column 'TB1' but only those sentences that are in column 'name'. I manually added column 'extract' so that it is clear what I mean.
- 1 year ago
pls try
Ahmedx
1 year agoSuper User
pls try
- matt_rac1 year agoRegular Visitor
Hi, this doesn't work on larger data. In my case it only returns "AB". Column #1 has 1000 rows these are long email contents. In column #2 there are 10,000 rows each row has unique item name some are contained in column #1. I would like to extract them.
- Ahmedx1 year agoSuper User
pls try this
=Text.Combine( List.Select(Search[name], (x)=> Text.Contains([TB1],x ,Comparer.OrdinalIgnoreCase)),", ")- matt_rac1 year agoRegular Visitor
Unfortunately, it doesn't return what I need. If I use the LOOKUP(2^99,SEARCH($E$2:$E$10000;A2);$E$2:$E$10000) function in Excel, it will return the expected values, but I would like to have it in power query because I need to update the data sometimes.