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

Did you hear? There's a new SQL AI Developer certification (DP-800). Start preparing now and be one of the first to get certified. Register now

Reply
aspendus
New Member

UDF query help

Hi! Question: I have some data in an external database, which I can query in PowerBI through DirectQuery. However, I also have a UDF (user defined function) in that external database that takes some input parameters and then performs a Select query and returns the results the way a normal select query would do. Is it in any way possible to call this UDF from PowerBI? All I've found so far is how to use SQL/DAX to write a new query, but I already have my (complicated) query in that UDF and I don't want to rewrite it in each external tool that needs to use it. Thanks!

1 ACCEPTED SOLUTION
RayWu
Memorable Member
Memorable Member

@aspendus  You can make a parameterized view that uses your function, then PBI thinks it's a regular select query

There's a little information here. https://docs.microsoft.com/en-us/power-bi/guidance/power-query-folding

View solution in original post

1 REPLY 1
RayWu
Memorable Member
Memorable Member

@aspendus  You can make a parameterized view that uses your function, then PBI thinks it's a regular select query

There's a little information here. https://docs.microsoft.com/en-us/power-bi/guidance/power-query-folding

Helpful resources

Announcements
April Power BI Update Carousel

Power BI Monthly Update - April 2026

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

Fabric SQL PBI Data Days

Data Days 2026 coming soon!

Sign up to receive a private message when registration opens and key events begin.

New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.