powerbi

Edit Queries (data import)

Remarks#

This technique can also be used for other data sources e.g. files, web services.

Note that when you do change these settings, you may have to specify Authentication/Credential details for the new source.

Preventing data source string duplication

By default, when data is imported to the PowerBI Desktop, each table or query stores data source details separately, even if they use the same data source.

This makes it tedious, for example, to change the source database of an entire PowerBI report - which requires changing each query source parameter individually.

There is a way to simplify this, described here.


  1. Import your data as you normally would. Example:

data source type - SQL server,
server name - localhost,
database - test1,
tables - table1, table2.

  1. In query editor, add two blank queries: “Get Data” -> “Blank Query”,

serverName with value = "localhost",
databaseName with value = "test1".
enter image description here

  1. For each table on the “Queries” pane on the left, select “Source” in “Query Settings” on the right, then substitute server and database names with parameters created in the step 2.

enter image description here
enter image description here enter image description here

  1. Now when you need to update your connection string, change serverName or databaseName and refresh data.

This modified text is an extract of the original Stack Overflow Documentation created by the contributors and released under CC BY-SA 3.0 This website is not affiliated with Stack Overflow