Forum Discussion
Replace References - changing data sources
- 7 years ago
Anonymous - You can first create a new connection to this data source and once the preview is loaded in Power Query mode, click on Advanced Editor and copy the script for the establishment of the connection to the newly created view. Go to your existing query and click on the Advanced Editor for that query and replace the string that you see after 'Let source' for your table with this and make the necessary changes in the script like making sure the commas are in place, and that the proper reference names are listed after "#"
Edit - Also, as a best practice I always declare Parameters for Server Name, Database Name etc, which you can utilize too, so as to make these kinda changes a little more easier.
Anonymous - You can first create a new connection to this data source and once the preview is loaded in Power Query mode, click on Advanced Editor and copy the script for the establishment of the connection to the newly created view. Go to your existing query and click on the Advanced Editor for that query and replace the string that you see after 'Let source' for your table with this and make the necessary changes in the script like making sure the commas are in place, and that the proper reference names are listed after "#"
Edit - Also, as a best practice I always declare Parameters for Server Name, Database Name etc, which you can utilize too, so as to make these kinda changes a little more easier.
nirvana_moksh That is a great way to change the entire data source. But is there a way for the actual 'replace reference' of fields like in tableau. Say I have a page with many views(or even an entire report). The (e.g.) "Total Cost" on all of the different views are connected to a specific field. If I would feel another field actually makes more sense to go under "Total Cost", is there any way I can use a few clicks or edit a query to replace the reference of this "Total Cost" to another field(It has to simultaneously change for all the views in the report)? Just like the REPLACE REFERENCE in Tableau. Thanks in Advance.