if i change a data source for example from one database to another database by editing the M Script, the previous used database connection still exists because when i publish the pbix to powerbi.com then the old database connection i still listed in the data sources.
The problem is that i cannot remove this data source and the impact is that i cannot schedule the dataset because of the old database connection (this was only a development database that does not exists anymore).
So how can i remove a database connection or data source that is not anymore used by any dataset?
So...this is not a solution, this is a workaround.
The problem remains that if you delete a datasource from your PowerBI Desktop file, it remains (forever, as far as I can tell) in the upload. Deleting a dataset and reuploading it is a huge pain when you have a minor dataset tweak (such as moving the dataset to new drive or different folder). This needs to have a true solution before it is marked as solved.
We recently moved a SQL server, and I updated the location in Data Source Settings screen succesfully in the query. Everything works fine when i refresh locally from PBI Desktop.
After publishing to Powerbi.com though, similar to the OP, the old data source still shows up in the Data Source Credentials screen, even though i've confirmed my data model doesn't reference it at all.
Tried everything outlinded here, I've deleted the data model, uninstalled and reinstalled the personal gateway, and uploaded the data model via both "get data" as well as "publish" and nothing seems to work.
Now my refreshes can't be scheduled since it thinks there is still some kind of reference to it, but if there was, how could the file refresh locally with no issue?