Forum Discussion

vicks123's avatar
vicks123
New Member
1 year ago
Solved

Import only few columns from a table in power query editor

Hi, I am importing a table from databricks and was successfulll. In order to gain more performance I am planning to bring only 10 required columns out of 35 from a table. I know here are the possibi...
  • BA_Pete's avatar
    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