Change Source in Power BI Desktop is disabled
Changing a Data Source connection in Power BI Desktop is very simple, just two or three clicks, as you can see in these two very simple methods:
Although it is a simple step to change the connection of a Data Source in Power BI Desktop, sometimes we face a problem that makes this change difficult, when the option button [Change Source ...] is disabled, which forces us to change manually within the Power Query Advanced Editor.
So, first we need to understand the logic that Power BI uses and why this option appears disabled. Everything happens within Power Query, as you can see, the first step we cannot exclude, precisely because Power BI understands that every first step of each query will be the Data Source. That is, if we start a query creating a variable instead of starting with the connection to the Data Source, the option to change the Data Source in the simple way you saw at the beginning of this article will be automatically disabled.
Conclusion:
What can we do to fix this problem? We need to create these variables in a separate query, so we can use these variables in any other Query and at any step of it, but not in the first, as you can see in the image below. Also, it is a good practice of queries organization.
So, the first step of Query will always be the Data Source and you will always have the option button to change the Data Source activated, because Power BI will always find your first stage of Query your Data Source.
Thank you for reading and give your feedback. 🙂