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

Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM. Register now.

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
Community Champion
Community Champion

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
Community Champion
Community Champion

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
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

Check out the October 2025 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Kudoed Authors