Don't miss your chance to take the Fabric Data Engineer (DP-600) exam for FREE! Find out how by watching the DP-600 session on-demand now through April 28th.
Learn moreJoin the FabCon + SQLCon recap series. Up next: Power BI, Real-Time Intelligence, IQ and AI, and Data Factory take center stage. All sessions are available on-demand after the live show. Register now
I need get the data to power bi using SQl functions
Is there any way to do this?
Thanks
Solved! Go to Solution.
hi @KavyaReddy
Yes you should be able to get data from SQL function ,
I did a test and I was able to get data from SQL function
following in the test function i have created
and i was able to pull data using that function using the SQL server database get data connector
Hi ,
Yes, you can get data into Power BI using SQL functions by connecting Power BI to your database and using SQL queries (including functions) in your data import process. Here's how you can do it:
Open Power BI Desktop.
Click on Home > Get Data > SQL Server (or another database type like MySQL, PostgreSQL, etc., depending on your data source).
Enter the server name and database details, and select DirectQuery or Import mode.
After connecting, you can choose to run a SQL query to get your data.
Instead of selecting tables directly, click on Advanced options and enter your SQL query with any functions you want to use.
Example:
SELECT
MyColumn,
dbo.MySQLFunction(MyColumn) AS FunctionResult
FROM dbo.MyTable
You can also use stored procedures or views in your SQL query to encapsulate the SQL functions, allowing you to run complex logic before pulling the data into Power BI.
When connecting, instead of selecting a table, you can execute a stored procedure that returns the data you need.
If the solution works for you, accept it as the solution. Let me know if you need any further help!
Hi ,
Yes, you can get data into Power BI using SQL functions by connecting Power BI to your database and using SQL queries (including functions) in your data import process. Here's how you can do it:
Open Power BI Desktop.
Click on Home > Get Data > SQL Server (or another database type like MySQL, PostgreSQL, etc., depending on your data source).
Enter the server name and database details, and select DirectQuery or Import mode.
After connecting, you can choose to run a SQL query to get your data.
Instead of selecting tables directly, click on Advanced options and enter your SQL query with any functions you want to use.
Example:
SELECT
MyColumn,
dbo.MySQLFunction(MyColumn) AS FunctionResult
FROM dbo.MyTable
You can also use stored procedures or views in your SQL query to encapsulate the SQL functions, allowing you to run complex logic before pulling the data into Power BI.
When connecting, instead of selecting a table, you can execute a stored procedure that returns the data you need.
If the solution works for you, accept it as the solution. Let me know if you need any further help!
hi @KavyaReddy
Yes you should be able to get data from SQL function ,
I did a test and I was able to get data from SQL function
following in the test function i have created
and i was able to pull data using that function using the SQL server database get data connector
Please provide a more detailed explanation of what you are aiming to achieve. What have you tried and where are you stuck?
Check out the April 2026 Power BI update to learn about new features.
If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.
A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.
| User | Count |
|---|---|
| 42 | |
| 37 | |
| 34 | |
| 21 | |
| 16 |
| User | Count |
|---|---|
| 65 | |
| 62 | |
| 31 | |
| 26 | |
| 25 |