Get certified for free when you join Fabric Data Days 2026 and dive into Fabric, Power BI, SQL, AI, and other essential data skills.
Join nowData Days is here! Join us now for 60+ days of learning, challenges, and connection. Learn more
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?
Don't miss out on Data Days, June 15 through August 7. Learn Fabric, Power BI, SQL, AI and more.
Check out the May 2026 Power BI update to learn about new features.
| User | Count |
|---|---|
| 23 | |
| 21 | |
| 20 | |
| 18 | |
| 13 |
| User | Count |
|---|---|
| 58 | |
| 50 | |
| 38 | |
| 31 | |
| 27 |