Forum Discussion
Ocasio27
Mar 02, 2020Iron Contributor
Adding query from the same worksheet
I want to add a query in the powerquery option from Tables inside the worksheet, so far only way I have found to do it is by opening the excel file itself as a query which is very inefficient.
I know the code "Source = Excel.CurrentWorbook()" is used for this but, can someone give me an example of how to use this.
Lets say my table is called "table1" and I want to add is as a query.
Also, if its a sheet, "sheet1"
- You can use From Table/Range in the PQ menu area, or this code if you want to code instead: = Excel.CurrentWorkbook(){[Name="MyTableName"]}[Content]
5 Replies
Sort By
- SaviaIron ContributorYou can use From Table/Range in the PQ menu area, or this code if you want to code instead: = Excel.CurrentWorkbook(){[Name="MyTableName"]}[Content]
- Ocasio27Iron Contributor
- Ocasio27Iron Contributor
I got this error when I try
"Formula.Firewall: Query 'Query1' (step 'Source') references other queries or steps, so it may not directly access a data source. Please rebuild this data combination."
Formula was
=Excel.CurrentWorkbook(){[Name=Table1]}[Content]
- SaviaIron ContributorThe option is in the Data menu in Excel in newer Office versions, or the Power Query menu in older ones. If adding directly from PQ just make a custom query. And it looks like you're missing the "" around the table name: = Excel.CurrentWorkbook(){[Name="Table1"]}[Content]
- Ocasio27Iron Contributor
I cannot find that table/range option in PQ. Which tab is that?