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

Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!

Reply
Anonymous
Not applicable

Invoke Custom Function

Hi

 

I'm trying to use the 'Invoke Custom Function' to populate a new column in a query.  The function requires a date parameter to be passed and a financial period is returned.

 

I've imported the function from a SQL Server database and tested it by passing in date from the selection calendar and the function returns the financial period as expected. When I 'Invoke Custom Function' to add a column and pass in the parameter, changing the parameter setting from 'date/time' to 'Column Name' and selecting my date column, the step completes but it returns errors with the following message;

 

GuyAinley_0-1611259758031.png

Does anyone have any ideas about getting around this?

 

Thanks in advance.

 

1 ACCEPTED SOLUTION
AlB
Super User
Super User

Hi @Anonymous 

It looks like your Period column is of type date and needs to be converted to datetime, which is the type the function expects

Please mark the question solved when done and consider giving a thumbs up if posts are helpful.

Contact me privately for support with any larger-scale BI needs, tutoring, etc.

Cheers 

 

SU18_powerbi_badge

 

View solution in original post

3 REPLIES 3
Anonymous
Not applicable

Hi @AlB 

 

Thanks for the response but the value being passed is DateTime and the result (Period) is Int. 

 

I'm still struggling to resolve this, any ideas?

 

Regards 

Anonymous
Not applicable

I found the solution.  The parameter needs to be DateTime and not just Date. 

AlB
Super User
Super User

Hi @Anonymous 

It looks like your Period column is of type date and needs to be converted to datetime, which is the type the function expects

Please mark the question solved when done and consider giving a thumbs up if posts are helpful.

Contact me privately for support with any larger-scale BI needs, tutoring, etc.

Cheers 

 

SU18_powerbi_badge

 

Helpful resources

Announcements
April AMA free

Microsoft Fabric AMA Livestream

Join us Tuesday, April 09, 9:00 – 10:00 AM PST for a live, expert-led Q&A session on all things Microsoft Fabric!

March Fabric Community Update

Fabric Community Update - March 2024

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

Top Solution Authors
Top Kudoed Authors