Forum Discussion
direct query vs. import
When querying a database, what's the difference between direct query and import? Thanks.
- Anonymous9 years ago
ammartino44This page will help. But essentially here are the basics
Import - extracts the data from your database and pulls it into the Power BI Desktop
Direct Query - leaves the data in the database and sends queries to pull the information needed.
Other things to note:
Import -
Gives you the full suite of transformation and data manipulation in the Desktop
There is a 1 GB limit to the Desktop if you plan on publishing to the PBI Service
Consumes and pushes the data into the Power BI Azure backend (Azure DB/Blob Storage) (In the Service)
Can only be refreshed up to 8x a day by setting up a scheduled refresh (In the Service)
Direct Query -
Limits your ability to manipulate data in the Desktop (removes the Data section)
Leaves the data in the SQL database
Is "live", no need to schedule a refresh (In the Service)
Both methods require a gateway to be installed, unless you are talking about Azure SQL.
8 Replies
- AnonymousNot applicable
ammartino44This page will help. But essentially here are the basics
Import - extracts the data from your database and pulls it into the Power BI Desktop
Direct Query - leaves the data in the database and sends queries to pull the information needed.
Other things to note:
Import -
Gives you the full suite of transformation and data manipulation in the Desktop
There is a 1 GB limit to the Desktop if you plan on publishing to the PBI Service
Consumes and pushes the data into the Power BI Azure backend (Azure DB/Blob Storage) (In the Service)
Can only be refreshed up to 8x a day by setting up a scheduled refresh (In the Service)
Direct Query -
Limits your ability to manipulate data in the Desktop (removes the Data section)
Leaves the data in the SQL database
Is "live", no need to schedule a refresh (In the Service)
Both methods require a gateway to be installed, unless you are talking about Azure SQL.
- wmorris20Helper II
The more I research DirectQuery (Both SQL Server and SAP HANA), the more I debate the true differences between DirectQuery and Import. When I watch the queries coming out of Power BI Desktop, it's clear to me that it's requesting data at the lowest grain regardless of the filters you've chosen. Essentially, there's no way to get the WHERE clause, so it's completely dependent on you choosing only dimensions that are aggregated in some way (i.e. year). I have no ability to intially filter on date and then aggregate by year.
I kind of understand this from the perspective of SQL Server is not meant to be an aggregation mechanism, but then what's the point of having DirectQuery in the first place? The only major differences are what you've already stated. The big one being the data is stored in memory instead of in the pbix file.
- AnonymousNot applicable
wmorris20 I can't say I've spent alot of time examining the difference in what is being passed to the database when you are comparing the two methods as you have, but the major difference between the connections is frequency and/or where the data lives.
Import pushes the data into Azure (behind Power BI), and only let's you refresh 8x per day. (48x with Premium)
Direct Query - the data stays in the data source. As a user interacts, it is live, no need to refresh.
From what I have analyzed with DQ against SQL, there is additional syntax that is added to SQL queries when doing direct query when I've explicitly executed SQL commands from Power BI. Import just executed the command itself. But I never took a look further in DQ at the actual messages as I interacted with the reports.
- AnmolganPost Prodigy
I dont understand the points that re pointed out here, can you give me brief details on some major differences b/w import and direct query???
- AnonymousNot applicable
Anmolgan I have a blog series describing the connections that might help.
Overview - https://powerbi.tips/2017/10/power-bi-connection-types/
Import - https://powerbi.tips/2017/11/power-bi-connections-import/
Direct Query - https://powerbi.tips/2017/12/power-bi-connections-direct-query/