Forum Discussion
Transform multiple queries at once
Hi,
I have 60 queries for different tables. I want to apply the function Table.FirstN to all of them.
I tried selecting all and using the function Keep Rows but it only affected one query.
Is there an easy way to add an additional step to all of the queries that keeps the first 100 rows.
Best regards,
Mattias
Yes, trick is to get a "table-view" of all your DB-tables where you can add a column. See how this works for a SQL-DB here:
The code as a function you can find here: https://gist.github.com/ImkeF/7f4fca8f7a7334d7fe7fb1ec761711da
6 Replies
- ImkeFCommunity Champion
Yes, trick is to get a "table-view" of all your DB-tables where you can add a column. See how this works for a SQL-DB here:
The code as a function you can find here: https://gist.github.com/ImkeF/7f4fca8f7a7334d7fe7fb1ec761711da
- AnonymousNot applicable
Thanks ImkeF this is great. Is there a way to output the db-tables to different tables in power query? i.e. having one pquery query per db table
- ImkeFCommunity Champion
Not with this additional transformation, unfortunatly.
The only way to create one query per table is through the steps via the manual UI where you click each table and one query will be created for each of them.