I have come up with this way to select columns based on text content ( cat , dog) , but it involves nested
List.Transforms, so I wondered if anyone has a different approach , I have attached the workbook with two examples,
![]()
let Source = Excel.CurrentWorkbook(){[Name="Table1"]}[Content], ToCol = Table.ToColumns( Source ), Split_contain = List.Transform( ToCol, (A)=> List.Transform(A, (B)=> List.ContainsAny( Splitter.SplitTextByWhitespace() (B), {"cat","dog"} ) ) ), TrueFalse = List.Transform( Split_contain, (x)=> List.AnyTrue(x)), Positions = List.PositionOf( TrueFalse, true, Occurrence.All ), ColNames = List.Transform( Positions , (A)=> Table.ColumnNames( Source ){A} ), Custom7 = Table.SelectColumns( Source , ColNames ) in Custom7
If anyone has any thought on a different approach I would be interested.
Richard.
Bookmarks