Forum Discussion
Expression.Error: We cannot convert the value "[Function]" to type Function
Greg_DecklerI tried deleting the function and adding it back, but the same error occurs.
Thanks for the suggestion. Like you said, "not ideal" because it if worked... it would indicate some weird error in PBI. But hey I'll take any workaround I can get at this point!
I had similar problem. My function referenced another query in that dataset directly. The problem disappeared when I passed that query as a function parameter like that:
let
CustomFunction = (Date as date, CurrencyCode as text, OperationAmount as number, RateTable as table) as nullable number =>
instead of:
let
CustomFunction = (Date as date, CurrencyCode as text, OperationAmount as number) as number =>
let
// Get the matching row from [raw]NBU Currency rates query
FilteredRow = Table.SelectRows(#"raw NBU Currency rates", each [Date] = Date and [Currency ID] = CurrencyCode),
It has something with the row context in which the add column function executes. Not sure what it is. I used ChatGPT to code these and then modified manually to get it working.