Forum Discussion
Convert DirectQuery Mode to Import
- 4 years ago
hatchda You can filter a Direct Query, so click 'Transform Data' to open Power Query, and add a filter to your tables for in the last or current year. Then apply changes, then swap to import.
- 4 years ago
One note bcdobbs with using a SQL statement is that you will lose any ability of query folding after that, so unless you plan to do everything in a SQL statement, might actually be better to take your first suggestion of filtering.
If you click transform data while still in direct query mode you can apply filters in Power Query to limit the data. Or if you need to limit it via SQL query do the same by clicking the cog next to "Source"
and enter the SQL query there.
Once done if you switch to import mode it will just load that subset.
- AllisonKennedy4 years agoCommunity Champion
One note bcdobbs with using a SQL statement is that you will lose any ability of query folding after that, so unless you plan to do everything in a SQL statement, might actually be better to take your first suggestion of filtering.
- bcdobbs4 years agoCommunity Champion
Cheers AllisonKennedy, should have made that much clearer. I added it in, in case there was no easy way to filter by year without a join. That said one of my favourite recent discoveries is the following which lets you enable folding with native queries: https://m.youtube.com/watch?v=8hjdOCni_ZY
- AllisonKennedy4 years agoCommunity Champion
bcdobbs Thanks for the link! My mind is blown! I really need to prioritise my Query Folding learning journey, I'm clearly waaay behind the game. Have had this on my watchlist for ages: https://www.youtube.com/watch?v=9sV3hIn8VTY&list=PLKW7XPyNDgRCorKNS1bfZoAO3YSIAVz3N