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
Anonymous
Not applicable

change data connection from database to API

I connected data from database with SQL by ODBC, now as the policy reason the ODBC connection method should change to get data from API, as I had created lots of reports use original data, how can I change the connection method from ODBC to API?

null_0-1653295101070.png

 

1 ACCEPTED SOLUTION
v-kkf-msft
Community Support
Community Support

Hi @Anonymous ,

 

Please try using XMLA endpoints to change data sources of Power BI dataset.

 

Using XMLA endpoints to change data sources in a Power BI dataset 

 

This is my test steps to change the SharePoint Online data source to a local SQL Server data source using Tabular Editor on Power BI Service.


1. Open a Tabular Model from an existing database (Ctrl+Shift+O). The server name is the URL of your PPU/Premium workspace, and then log in with your Power BI account.

 

vkkfmsft_0-1653548208318.png

 

2. Find the partition of the table and you can see that the partition’s M expression shows that the dataset comes from an Excel file on SharePoint Online.

vkkfmsft_1-1653548208769.png


3. Then you need to change the partition’s M expression to SQL Server data source as the following example. Save the changes to the dataset.

 

vkkfmsft_2-1653548208681.png


4. Configure the credentials of the new data source for this dataset on Power BI Service and refresh the dataset.

 

Note that it is important to ensure that the structure (including table name, column names) of the table imported from the new data source and the old data source are the same, so as to ensure a successful refresh after modifying the data source.

 


If the problem is still not resolved, please provide detailed error information or the expected result you expect. Let me know immediately, looking forward to your reply.
Best Regards,
Winniz
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

2 REPLIES 2
v-kkf-msft
Community Support
Community Support

Hi @Anonymous ,

 

Please try using XMLA endpoints to change data sources of Power BI dataset.

 

Using XMLA endpoints to change data sources in a Power BI dataset 

 

This is my test steps to change the SharePoint Online data source to a local SQL Server data source using Tabular Editor on Power BI Service.


1. Open a Tabular Model from an existing database (Ctrl+Shift+O). The server name is the URL of your PPU/Premium workspace, and then log in with your Power BI account.

 

vkkfmsft_0-1653548208318.png

 

2. Find the partition of the table and you can see that the partition’s M expression shows that the dataset comes from an Excel file on SharePoint Online.

vkkfmsft_1-1653548208769.png


3. Then you need to change the partition’s M expression to SQL Server data source as the following example. Save the changes to the dataset.

 

vkkfmsft_2-1653548208681.png


4. Configure the credentials of the new data source for this dataset on Power BI Service and refresh the dataset.

 

Note that it is important to ensure that the structure (including table name, column names) of the table imported from the new data source and the old data source are the same, so as to ensure a successful refresh after modifying the data source.

 


If the problem is still not resolved, please provide detailed error information or the expected result you expect. Let me know immediately, looking forward to your reply.
Best Regards,
Winniz
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

amitchandak
Super User
Super User

@Anonymous , Little bit tricky, when it across different type of connection

Change Connection from One source type to another Source Type: https://youtu.be/nwYJgG2hmd0

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

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.