Connecting to Data Sources
Learn to connect Power BI to a broad set of data sources, authenticate securely, and choose the right connectivity mode for your needs.
Content
Import vs DirectQuery vs Live Connection
Versions:
Watch & Learn
Import vs DirectQuery vs Live Connection — The Power BI Dating Guide (Pick the right partner)
You already made your first report, met the Power BI ecosystem, and know the basic moves. Now it's time for a relationship talk: how should Power BI connect to your data? This choice will decide whether your reports are fast and flexible, painfully slow, or mysteriously incomplete. Choose wisely.
Why this matters (yes, really)
You learned how to make a report in the previous module. Great. Now imagine that same report but with a million-row table live-updating every second, or a 50GB database behind it. Suddenly, performance, accuracy, security, and what features you can actually use start to fight like siblings over the remote.
This lesson explains the three main connection modes in Power BI:
- Import
- DirectQuery
- Live Connection
We'll break down what each one is, when to use it, what features are available or blocked, and a pragmatic decision flow so you can stop guessing and start designing.
Quick definitions — the elevator pitch
Import: Power BI pulls data from the source into its own internal model (VertiPaq). Fast queries, full modeling power, but you need to refresh to get new data.
DirectQuery: Power BI does not import rows. Instead, it sends queries to the source at report time. Data is fresh on demand, but not all modeling features are available and performance depends on the source.
Live Connection: Similar to DirectQuery but specific to semantic models like SQL Server Analysis Services (SSAS) or Power BI datasets. You connect to someone else s model; you cannot change the model locally.
Side-by-side comparison
| Feature / Mode | Import | DirectQuery | Live Connection |
|---|---|---|---|
| Where data lives | In Power BI dataset (in-memory) | At source | At source/semantic model |
| Data freshness | Requires scheduled or manual refresh | Near real-time (query at view time) | Near real-time (query at view time) |
| Modeling flexibility | Full: calculated columns, measures, relationships | Limited: measures OK, calculated columns discouraged/limited | None in report: model controlled externally |
| Performance | Fast for users (in-memory engine) | Depends heavily on source and query folding | Depends on SSAS or dataset performance |
| Row-level security | Implementable in Power BI | Possible, but source must support | Managed in semantic model |
| Use case | Small to medium datasets, heavy transformations, advanced visuals | Large tables, regulatory need for live data | Centralized enterprise semantic layer |
Deep dive with human analogies
Import is like copying a cookbook into your kitchen. You can chop, mix, and rewrite recipes all you want. The fridge sits in your house, so service is fast. But if the chef updates the original recipe, you have to copy the cookbook again.
DirectQuery is like ordering from a restaurant every time you want a dish. Fresh food, but you depend on the restaurant s speed and menu. Some customizations might not be possible.
Live Connection is like being allowed to sit at the restaurant s chef table and use their recipe book — but you cannot take a pen and change the recipes; you must request the chef to change things.
Pros, cons, and gotchas (practical notes)
Import
- Pros: blazing query performance, full DAX and modeling features, supports large number of visuals and complex measures
- Cons: dataset size limits (Power BI Pro limit, Premium larger), refresh windows and frequency, initial import can take long
DirectQuery
- Pros: live or near-live data, no dataset size limit on Power BI side, avoids data duplication
- Cons: limited modeling; visuals may be slower; every user action can trigger queries; query folding and source indexing become critical
Live Connection
- Pros: single semantic layer for enterprise governance, centralized model management
- Cons: no local model edits, limited personalization, dependent on SSAS or another dataset owner
Important: some features are restricted in DirectQuery/Live Connection, e.g., some quick measures, complex DAX patterns, or custom storage engine features. If you rely on advanced calculated columns done during import, they might not have an equivalent in DirectQuery.
Technical realities you need to remember
Query folding: in Power Query, folding means pushing transformations to the source. With Import, folding helps performance during refresh. With DirectQuery, folding is crucial because pushing logic to the source keeps queries efficient. If folding breaks, expect performance disasters.
Aggregations: Use aggregation tables (imported) together with DirectQuery for detail tables. This hybrid pattern gives users the best of both worlds: fast high-level visuals and live detail queries.
Caching and timeouts: DirectQuery often uses caching to reduce load, but caches expire. Also, query timeouts at the source can bite — configure gateway and source settings.
Security: Row-level security needs careful design. With Live Connection, security is usually enforced in the semantic model. With DirectQuery, RLS can be enforced either in the source or within Power BI depending on setup.
Decision flow — choose your mode in 5 steps
- How fresh does the data need to be? If near real-time, consider DirectQuery or Live Connection.
- Do you need heavy modeling and custom columns? If yes, Import is your friend.
- Is the dataset enormous or governed by IT s single semantic model? If yes, consider DirectQuery or Live Connection.
- Can the source handle analytical queries and support query folding? If no, prefer Import or build a separate analytical store.
- Do you need centralized governance and reusability? Live Connection wins for enterprise semantic models.
Quick pseudocode decision:
// Pseudocode
if need_frequent_refresh and source_supports_analytics then
use DirectQuery
else if need_full_modeling_or_offline_speed then
use Import
else if centralized_semantic_model_exists then
use Live Connection
end
Real-world examples
- Small company sales reporting, 10 GB data, heavy custom columns and transformations: Import, schedule refresh nightly.
- Retail chain with PoS updates every 5 minutes, central OLTP database built for analytics: DirectQuery with optimized views and indices.
- Enterprise with a governed SSAS semantic model maintained by IT: Live Connection for all business reports to keep consistency.
Expert take: pick the simplest mode that satisfies your requirements. Complexity is the enemy of both performance and maintainability.
Closing — key takeaways and next steps
- Import = speed and flexibility, but needs refresh.
- DirectQuery = live data, but depends on the source and limits modeling power.
- Live Connection = enterprise control, but you cannot edit the model locally.
Next steps for your learning path (builds on your first report):
- Recreate your first report using Import, perform a refresh, and note performance.
- Try switching to DirectQuery against a small SQL view and observe what DAX or visuals break.
- If you have access, connect to a shared Power BI dataset or SSAS using Live Connection and see how report-level modeling is restricted.
Final thought: there is no free lunch. You will balance freshness, functionality, and governance. Think like an architect: design for users first, but plan for scale. Then, laugh maniacally and test it.
Version note: This lesson builds on previous modules about creating your first report and Power BI core concepts. You re now making the critical infrastructure choice that will shape future work.
Comments (0)
Please sign in to leave a comment.
No comments yet. Be the first to comment!