Forum Discussion
Expression.Error: We cannot convert the value "[Function]" to type Function
Anonymous Something to try but not ideal. Try copying your function code from Advanced Editor and paste into notepad or something. Delete function. Recreate function and paste in code. Save. @ me if this does not work or if it does, I'd like to know!!
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!
- EugeneNovikov1 year agoFrequent Visitor
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.