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.
Import your data as you normally would. Example:
data source type - SQL server,
server name -
Now when you need to update your connection string, change
databaseName and refresh data.