How to Change the data source in Power BI

How to Change the data source in Power BI

(And keep all your existing visuals, calculated columns and measures working)

If you have been working with a static dataset in Power BI and you need to change it to become refreshable, this article outlines the steps and benefits of doing so

If you follow this carefully you will ensure that all of your existing visuals, calculated columns and measures will continue to work, making the change seamless

Always make a copy of your PBIX file before you start….just in case

At first glance there is no obvious way to change the data source

We will follow theses steps

  1. Add a new refreshable data source
  2. Copy the connection details from the new source
  3. Apply the connection details to the old data source
  4. Delete the new data source

Step 1 — add the new refreshable data source

how to add a SQL data source to Power BI


Step 2 — Copy the connection details from the new source

You now have two data sources, the second one being your new refreshable connection

We will grab the details of this new connection

Right click and select edit query, then go to advanced editor


data sources in Power BI

In the advanced editor

Copy the code from this entire block

Power BI data sources advanced editor screen

Then close the advanced editor

Step 3 — Apply the connection details to the old data source

Still in the power Query Editor

Select the original dataset, and go into?its?advanced editor

In the Advanced Editor

Highlight all of the code

And paste the new code from the clipboard

Click ‘Done’, then Close and Apply

Power BI data sources, close and Apply button

Step 4 — Now delete the second dataset

Power BI Data Sources field list showing the delete option

The original CSV dataset is now replaced with the SQL connected dataset

Any calculated fields will still work and all visuals which referred to the original dataset will still work

The Alternative

The alternative would be to add the new refreshable data set, then you would have to individually change every visual, calculated field and measure to refer to your new data set. This would be a lot of work and not without risk of error, as well as being very boring

For more Business Intelligence tips covering SQL, Power Bi and Excel follow, subscribe or follow our You Tube Channel


#powerbi #Powerbidatasource #powerbitips

要查看或添加评论,请登录

Select Distinct的更多文章

社区洞察

其他会员也浏览了