Forum Discussion
Repeat Power Query for different Tables in the same workbook
- 6 years ago
Anonymous
I said leave only the tables with data. You have Planinha1 and Join as worksheet still. Why? Remove them. Then it will work. An alternative is to remove the corresponding rows for those two worksheets in the M code, immediately after the Source step in the main query. Again, do not load the result of the main query (Consulta1) to an excel table, load it through a connection only into the data model. And again, once this works I would recommend keeping the data tables in one file and the queries and processing in another one (you would only have to change the way you get your tables at the beginning of the main query, since it will not be with Excel.Currentbook( ))
Please mark the question solved when done and consider giving kudos if posts are helpful.
Contact me privately for support with any larger-scale BI needs
Cheers
Thank you so much AlB!
I'm really new to functions and parameters, so I don't know if I did something wrong, because in the step 2 I got the error:
It means that field "Data" already exists in the register.
All I did was the following:
1. Deleted all the 4 queries
2. Created one blank query and pasted the first code, renamed it to processTableFunct_
3. Created one blank query and pasted the second code
Is there maybe some step before or after that I missed? Like I said, I don't know much about functions so if you could be very specific I appreciate it.
Can you check it out, please? I included the updated file if it helps
https://drive.google.com/file/d/1mfiB7r_Sc9TdZyjeqCrjogDOlXcNwCfL/view?usp=sharing
Anonymous
I said leave only the tables with data. You have Planinha1 and Join as worksheet still. Why? Remove them. Then it will work. An alternative is to remove the corresponding rows for those two worksheets in the M code, immediately after the Source step in the main query. Again, do not load the result of the main query (Consulta1) to an excel table, load it through a connection only into the data model. And again, once this works I would recommend keeping the data tables in one file and the queries and processing in another one (you would only have to change the way you get your tables at the beginning of the main query, since it will not be with Excel.Currentbook( ))
Please mark the question solved when done and consider giving kudos if posts are helpful.
Contact me privately for support with any larger-scale BI needs
Cheers