Forum Discussion

MStaford's avatar
MStaford
Regular Visitor
1 year ago
Solved

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