Forum Discussion
How to update all Queries in Power Query Editor
- 1 year ago
You can create a Parameter for Schema Name
Name: SchemaName
Value: "BAORAO02_Silo2" (or any other schema name)Or you can create a Central Function to Retrieve the Schema
Go to Power Query Editor → New Query → Blank Query
Open Advanced Editor and paste:
(schemaName as text) =>
let
Source = Odbc.DataSource("dsn=ABC112", [HierarchicalNavigation=true]),
ABC112_Database = Source{[Name="ABC112",Kind="Database"]}[Data],
Selected_Schema = ABC112_Database{[Name=schemaName,Kind="Schema"]}[Data]
in
Selected_Schema
Rename this query to GetSchema.
I believe you can do this in TMDL View (preview). Once enabled and opened up:
1) select all applicable queries
2) drag into the script window, which will drop all the query definitions into the editor including M script
3) make whatever changes you want (editor provides ootb find/replace)
4) hit Apply at the top
5) refresh
E.g. here is the TMDL for a super simple table. I added the highlighted via TMDL, hit Apply, hit refresh, and change flowed through
I'm getting an error message when dragging multiple tables to the TMDL view?