Yes, column names and their contents can be used as wildcards to search for strings in other columns in Power Query.
To use this feature, you can create a custom function that takes the column name and the search string as inputs, and then dynamically generate a filter expression that targets the specified column.
For example, the following code searches for all rows where the "Product" column contains the string "apple", using the "Product" column name as a wildcard:
let Source = Excel.CurrentWorkbook(){[Name="SalesData"]}[Content], SearchString = "apple", FilterExpression = "= Text.Contains([" & Product & "], """ & SearchString & """)", FilteredRows = Table.SelectRows(Source, each Expression.Evaluate(FilterExpression, #table({Product}, {{[Product]}}))) in FilteredRows
Note that this code assumes that the data is stored in an Excel table named "SalesData", and that the "Product" column exists in this table. You'll need to adjust the code accordingly for your specific data source and column names.
Asked: 2023-07-09 07:21:33 +0000
Seen: 15 times
Last updated: Jul 09 '23