Forum Discussion
Import only few columns from a table in power query editor
- 1 year ago
Hi vicks123 ,
While writing an SQL SELECT statement will get you what you want in the short term, be mindful that any additional (simple) transformations done on the initial query in Power Query will be performed locally. Additionally, if you choose to write all of your transformations in the SQL SELECT, then you may find your query becomes difficult to maintain in the future, especially if passed to another PBI dev who doesn't 'speak' SQL as well.
The best method would be to query your source while maintaining query folding, so subsequent transformations are also sent back to the source to process.
To do this with Databricks, you can either use the Databricks.Query connector or, if you need to use Databricks.Catalogs, you can wrap it in a Value.NativeQuery and include the [EnableFolding=true] argument, something like this:
Pete
Using a SQL SELECT query is the most efficient method to import only the required 10 columns from Databricks, minimizing data load and improving performance directly at the source.