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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

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 II
Advocate II

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


@ 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
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

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

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.

Top Solution Authors