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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
David0802
Frequent Visitor

Gateway fails with a SQL db function call

I have a PowerBI report that connects to a SQL database and pulls data from database views. When I deploy this PowerBI report, it deploys and works fine on the PowerBI service. 

  • If I then add a database function as a data source within PowerBI Designer, in the same database using the same connection string, the report still works well, sending my parameters to the function and returning the results of the function ok. 
  • When I go to publish the report however, the report is published but the data source is disconnected. If I remove the function as a datasource it works ok again.

I'm clearly having issues enabling the PowerBI Service to execute my database function, but PowerBI Designer is fine. I've reinstalled the Data Gateway (on-premise, personal mode) but without resolution. 

 

Does anyone know any special settings to use to enable database function calls via the PowerBI service? Thanks in advance. 

2 REPLIES 2
GilbertQ
Super User
Super User

Hi @David0802 

 

As far as I know it is not possible to use SQL functions via the Gateway.





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!







Power BI Blog

Thanks @GilbertQ , I've tried to wrap this into a DirectQuery SQL submission rather than just the function, but still no luck. I think you might be right. I researched further today and can see a Microsoft link that doesn't allow Stored Procedures to be called, but not specifically ruling out Functions...which I think should still be allowed but perhaps only in Import mode. 

 

I'll persevere, would be a good outcome if I can get working. 

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

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.