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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
MV23
Frequent Visitor

SQL Functions in Power BI

I have a sql function defined in my Azure SQL Server database.

Does anyone know how I can call that function in Power BI?

I am able to see that function in the Data Sources tab and did select it. I want to use that function to create a new column in the tabular representation of the data in Power BI.

1 ACCEPTED SOLUTION

Thanks. I was able to get to it this way.

1. Select the sql function when you initially select your data sources. If you forget to do that, click on "Get Data" or "Recent Sources" and select the function you'd like to add.

2. Then, click on "Edit Queries".

3. Select the table that you want to add the new column to.

4. Click on "Add column".

5.  Click "Invoke Custom Function".

6.  Give your new column a name.

7. Select the function you wanted to call.

8. Add a parameter if you'd like. You can either add a value or select an existing column.

9. Hit "Ok" and you will have your new column.

View solution in original post

4 REPLIES 4
v-jiascu-msft
Employee
Employee

Hi @MV23,

 

Could you please mark the proper answer as solution or share the solution if it's convenient for you? That will be a big help to the others.

 

Best Regards!
Dale

Community Support Team _ Dale
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Thanks. I was able to get to it this way.

1. Select the sql function when you initially select your data sources. If you forget to do that, click on "Get Data" or "Recent Sources" and select the function you'd like to add.

2. Then, click on "Edit Queries".

3. Select the table that you want to add the new column to.

4. Click on "Add column".

5.  Click "Invoke Custom Function".

6.  Give your new column a name.

7. Select the function you wanted to call.

8. Add a parameter if you'd like. You can either add a value or select an existing column.

9. Hit "Ok" and you will have your new column.

Hi @MV23,

 

Thank you for sharing with the community!

 

Best Regards!

Dale

Community Support Team _ Dale
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Anonymous
Not applicable

Yes you can!  I've done this recently with an SQL database.  When you say "Get Data" and select your Server/Database, there is an Advanced Options.  There will be an SQL statement box.

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

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

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.