Forum Discussion
MStaford
1 year agoRegular Visitor
Case insensitive table.findtext across multiple columns
Hi All, I have a situation where I have to bring across only those rows where a specific values specific value (lets say, "true") appears in 5 selected columns with multiple files with each includi...
- 1 year ago
Hi MStaford
Still using the same code in my initital post but changing List.AllTrue to List.AnyTrue to check if at least one of the column values contains the word true..
let // Step 1: Define a list of values, replace with the actual column names ColumnsAsAList = {[bla1], [yaba2], [daba3], [lama], [doo]}, // Step 2: Convert each value in the list to a logical (true/false) ChangedType = List.Transform(ColumnsAsAList, Logical.From), // Step 3: Check if all values in the list are true. Use List.AnyTrue to return true if any of the values in the list is true TrueOnly = List.AnyTrue(ChangedType) in TrueOnly
danextian
1 year agoSuper User
Hi ryan_mayu
Try this custom column in the query editor. Use List.AnyTrue to return true if any of the values in the list is true
let
// Step 1: Define a list of values
ColumnsAsAList = {[bla1], [yaba2], [daba3], [lama], [doo]},
// Step 2: Convert each value in the list to a logical (true/false)
ChangedType = List.Transform(ColumnsAsAList, Logical.From),
// Step 3: Check if all values in the list are true. Use List.AnyTrue to return true if any of the values in the list is true
TrueOnly = List.AllTrue(ChangedType)
in
TrueOnly