Using M to do calculation across multiple columns in Power Query and ignore case

Viewed 44

I am using the M code below to search multiple columns for either the words "Pass" or "Fail". Is there a way to make it case insensitive. Tried to using Comparer.OrdinalIgnoreCase to no avail. Thanks

List.Count(
List.Select(
Record.ToList(_),
each _ ="Pass" or _ ="Fail")
            )
2 Answers

enter image description here

= Table.AddColumn(#"Changed Type", "Custom", each List.Count(
List.Select(
Record.ToList(_),
(x)=>
Logical.From( Comparer.OrdinalIgnoreCase(x, "pass")) 
and 
Logical.From( Comparer.OrdinalIgnoreCase(x, "fail"))
)))

I would have just used

List.Count(
List.Select(
Record.ToList(_),
each Text.Upper(_) ="PASS" or Text.Upper(_) ="FAIL")
        )
Related