Forum Discussion
We cannot convert a value of type Function to type Logical IF function
- 3 years ago
change
each if (F1)=>
to
(F1) => if
Hi Artemus,
Thank you for the answer, that has worked and I think the first part of the formula within List.AnyTrue is working because the results are now split into "0"'s..for the "Falses" and errors for the "Trues", the error for the "Trues" is:
"Expression.Error: There is an unknown identifier. Did you use the [field] shorthand for a _[field] outside of an 'each' expression?"
Formula is now written like:
let
Source = Excel.CurrentWorkbook(){[Name="Table1"]}[Content],
#"Changed Type" = Table.TransformColumnTypes(Source,{{"Je Header Id", Int64.Type}, {"Description", type text}, {"Total", Int64.Type}}),
#"Added Custom" = Table.AddColumn(#"Changed Type", "Basic Pay1", (F1)=> if List.AnyTrue(List.Transform(Basic,each Text.Contains(F1[Description], _)))=true then [Total] else 0 )
in
#"Added Custom"
Are you able to advise on the error?
Thank you
- artemus3 years agoMicrosoft Employee
you would need to use F1[Total] instead of just [Total]
- BNiddrieDavies3 years agoRegular Visitor
Yaaaaaas!!!
Thank you, that has done it!!!
Hero! Many thanks