Skip to main content
Showing results for 
Search instead for 
Did you mean: 

Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started

Frequent Visitor

Expression.Error: We cannot convert the value "[Function]" to type Function

I have a report that I'm converting to a PBIT and then moving to another location to create a PBIX. This will involve changing some parameters to connect to other data sources.


I'm getting a problem with one query. I have a table where I've added columns using "Add Column" "Invoke Custom Function"

This works in the original report. But when I try to run the query in the PBIX imported from the PBIT file, I get this error:


Expression.Error: We cannot convert the value "[Function]" to type Function.
This seems to be a type mismatch but I can't figure out why or how to fix it. I created the column usign the dialog to select my fuction and it's arguments.
The statement is:
= Table.AddColumn(#"Changed Type", "Prior Visit", each PriorVisitIEN([EPI], [IEN]))
where PriorVisitIEN is the name of a custom function in the current file. I've tested it, and it works and the arguments are the right types.
Any clues will be greatly appreciated.
Thanks !



Advocate III
Advocate III

Hi @gitouttatown ,


I realise this is a long time ago, but I just ran into the exact same scenario (not for the first time), so I decided to give it some more time. Maybe it will also help someone else at some point.


The problem has nothing to do with your function or function call itself (that is, not with the semantics at least), but you run into the privacy firewall. I for one used a public resource to validate dates from different cultures via the function. Changing this resource to a organizational resource solved the problem. Not really the way I'd like to see things, but it works at least!


Thanks to this thread: Expression.Error: Cannot convert the value "[Function]" to type Function (




Super User
Super User

@gitouttatown 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!!

Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
The Definitive Guide to Power Query (M)

DAX is easy, CALCULATE makes DAX hard...

@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!

Helpful resources

July 2024 Power BI Update

Power BI Monthly Update - July 2024

Check out the July 2024 Power BI update to learn about new features.

Top Solution Authors