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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
gitouttatown
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.
Details:
Value=[Function]
Type=[Type]
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 !

 

 

3 REPLIES 3
C4YNelis
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 (microsoft.com)

 

Cheers,

Niels

Greg_Deckler
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

Announcements
RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.

LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.