Forum Discussion

matt_rac's avatar
matt_rac
Regular Visitor
1 year ago
Solved

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.

 

4 Replies

    • matt_rac's avatar
      matt_rac
      Regular 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.

      • Ahmedx's avatar
        Ahmedx
        Super User

        pls try this

        =Text.Combine(
        List.Select(Search[name], (x)=> Text.Contains([TB1],x ,Comparer.OrdinalIgnoreCase)),", ")