Forum Discussion
Copy columns to a new table using M
- 6 years ago
If by base table you mean the query that is importing from the file, and the "already imported table" is a reference to the base table, you cannot tell PQ to just use the smaller 100 column table, because that references the 3,000 column table.
If this were a relational database, Power Query would fold the query back to the server and tell it to only bring back the 100 columns you want. But with any kind of Excel file, text file, SharePoint list, or other non-DB data source, Power Query will always do every step. It doesn't know what 100 columns you want until it brings in the 3,000 first, then it knows which 2,900 to toss.
There is no way around this for text files. Power Query repeats every single step every single refresh.
Hi InspiredBI ,
Are you using PowerBI Desktop or Power Query from Excel?
If you use Power BI Desktop, use DAX function SELECTCOLUMNS with your imported table as source.
If you use Excel Power query, you can use Blank Query-> Excel.CurrentWorkbook() to expose imported table as source for your new query.
Hope this helps.
Feel free to request more details if needed.
Sincerely,
Mira Aciu