Skip to content

Connect to Data in Power BI

Step 1 of 24

PL-300: Connect to Data in Power BI and Choose a Storage Mode

Choose how Power BI reaches your data

Connecting to data in Power BI starts with three decisions: which connector can reach the source, which identity should authenticate, and how the semantic model should access the data. For example, a report built on a governed model needs different permissions and refresh settings from a report that imports files from SharePoint.

This lesson covers Get or connect to data within Prepare the data (25–30% of PL-300), using Microsoft’s skills outline effective April 20, 2026. You will configure credentials and privacy levels, compare Import, DirectQuery, and Direct Lake, and use Power Query parameters to change a source or filter.

Learning objectives

  • Identify the right connector and connection pattern for files, databases, online services and existing Power BI content.
  • Explain what a shared semantic model is and when to connect to one instead of re-importing data.
  • Configure data source credentials and privacy levels and predict their effect on query folding and data combination.
  • Choose between Import, DirectQuery and Direct Lake storage modes from stated requirements.
  • Create and use parameters to change a source, a filter value or a folder path.

1. Where the data comes from

Power BI Desktop uses Get data to open connectors. For sources you import or query through Power Query, the connector exposes data for preview and transformation. Once connected, continue with profiling and cleaning data in Power Query before loading. A live connection to a shared semantic model uses a different path: its data preparation stays in the source model. The exam expects you to recognise the main families:

Family Examples Typical considerations
Files Excel, CSV, JSON, XML, PDF, folder Path changes break refresh; a Folder connector combines many files with the same layout
Relational databases SQL Server, Azure SQL Database, Oracle, PostgreSQL Check connector and operation support for query folding and DirectQuery; private sources may need a gateway
Analytical stores Fabric lakehouse and warehouse, Azure Synapse, Databricks, Snowflake Check connector and capacity. Direct Lake uses supported Delta tables in OneLake, including eligible shortcuts.
Online services SharePoint Online list or folder, Dataverse, Dynamics 365, Salesforce Authentication depends on the connector, host, and connection type
Power BI content Power BI semantic models, dataflows Reuse of governed, already-modeled data
Web and APIs Web, OData Check connector authentication and pagination support; custom APIs may need additional M logic

Get data connector gallery in the Power BI service, filtered by family: File, Database, Microsoft Fabric, Power Platform, Azure, Online services

Example. Fabrikam Retail receives a monthly CSV export from each of 40 stores in a SharePoint document library. Instead of importing 40 files by hand, the analyst uses the SharePoint Folder connector, filters to the current year, and uses Combine files so one transform is applied to every file. When store 41 opens, dropping its CSV into the library is enough; the next refresh includes it.

Exam tip: when the stem says "files with the same structure will be added every month", think Folder + Combine. When it says "the data already exists in a certified model owned by the data team", think connect to the semantic model, not "import the underlying database again".

2. Shared semantic models and dataflows

A semantic model defines tables, relationships, measures, and security. A shared model is published to the Power BI service so multiple reports can reuse it. Many reports can connect live to the same model. This is the hub-and-spoke pattern: one team curates the model, report authors build thin reports on top of it.

Lineage view in the Power BI service: a data source feeds one semantic model, which feeds a report

How to connect: in Desktop choose Get data → Power BI semantic models (or the OneLake catalog), pick the model, and choose Connect. You can then build visuals and report-level measures. Things to know:

Picking a published semantic model in the Power BI service, with its owner, location, endorsement and sensitivity

  • You need Build permission on the semantic model to create new content from it. Read permission only lets you consume existing reports.
  • The connection is live: the report queries the shared model, which evaluates its measures and security. Test row-level security (RLS) with the intended viewer permissions. A live report does not create an independent copy of the model.
  • You can convert the connection into a DirectQuery connection to the semantic model to add your own tables and relationships (a composite model). This can combine the shared model with an imported Excel table if the tenant and source allow it. Before publishing, check permissions and licenses across the model chain. Source RLS protects that source’s data; it does not automatically apply to local tables or other sources.
  • Dataflows (Gen1 and Gen2) centralise Power Query logic so that several models reuse the same cleaned tables. A dataflow prepares data; a semantic model analyses it.
Need Best choice
Same measures and security for every report Shared semantic model, live connection
Same cleaned table reused by several different models Dataflow
Shared model plus one extra local table Composite model on the shared semantic model
One-off analysis of a file Import directly

Common trap: importing a shared model's data into a new local model duplicates logic, breaks the single source of truth, and makes security inconsistent. If the scenario stresses consistency and governance, reuse the shared model. When you need a model of your own, see building a Power BI data model for relationships and table design.

3. Data source settings, credentials and privacy levels

Data source settings

In Desktop, Transform data → Data source settings lists every source used by the file. Here you can change the source (for example when a server is renamed), edit permissions (credentials) and clear them. After publishing, check Gateway and cloud connections and Data source credentials in the semantic model settings. Connections and credentials may be managed centrally rather than inside one model.

Connection settings of a Text/CSV source in Power Query Online: data gateway, authentication kind and privacy level

Credentials

Pick an authentication method supported by the connector in the host you are using. Desktop uses your configured credentials; in the service the semantic model can use a managed cloud or gateway connection. Expired passwords, revoked tokens, or disabled accounts can break refresh. An organization-managed identity can reduce that dependency only where the connector, connection type, and service support it. DirectQuery to a remote Power BI semantic model uses single sign-on.

Authentication methods offered for a cloud Web connection: Anonymous, Basic, OAuth 2.0, Service Principal, Workspace identity

Semantic model settings in the Power BI service showing a data source credentials error that blocks refresh

For on-premises sources the service needs a gateway to reach the network. For an on-premises SQL Server source, map the model to a gateway connection with the same server and database values used in Desktop. Verify the gateway is online, the credentials work, and the model owner is allowed to use the connection.

New connection panel in the Power BI service: on-premises (through a gateway), virtual network, streaming virtual network or cloud

Privacy levels

Privacy levels tell Power Query how isolated each source is when it combines data from different sources in one query (for example merging a SQL table with an Excel file):

Level Meaning Combination behaviour
Private Sensitive or confidential Data from this source cannot be folded into other sources, including other Private sources.
Organizational Data within a trusted group Can fold into Organizational or Private sources, but not into Public sources.
Public Public data, such as an open-data file This level does not restrict folding its data into other sources.
None No privacy classification applied Does not provide a privacy isolation policy.

Privacy level options of a connection: None, Private, Organizational, Public

The firewall exists to prevent data leaking from one source into another: if the engine pushes values from a Private SQL table into a query against a web service (for example to filter it), those values would be sent to the web host. To avoid that, Power Query buffers or evaluates sources separately, which can disable query folding and slow refresh. Set levels based on the required isolation. They determine what folding is permitted; they cannot guarantee that a particular merge folds or refreshes. They also do not replace authentication or report access controls.

The Desktop setting Ignore privacy levels (Fast Combine) does not carry over to published Power BI semantic models. Read the full Formula.Firewall error. Incompatible sources need correct classifications and an allowed combination. A partition that both reads a source and references other partitions may require restructuring: stage the reads, combine their results in a separate query, and test refresh in the service.

Worked example 1: a firewall error. Scenario. An analyst merges a Sales table from Azure SQL Database (internal) with ExchangeRates from a public central-bank CSV on the web. In Desktop it works with Fast Combine on. After publishing, scheduled refresh fails with a firewall error. How should it be fixed without exposing sales data to the internet?

Reasoning.

  1. The service ignores Fast Combine, so privacy levels now matter.
  2. Sales is internal: set it to Organizational (or Private if very sensitive).
  3. The central-bank CSV is public: set it to Public.
  4. With privacy enforced, Organizational sales values cannot fold into the Public web source. The public rates may be used on the internal side. This permission does not guarantee the merge will fold.
  5. If the query structure is the problem, stage both source queries and have a third query reference and merge them. If policy requires, ingest the rates into approved internal storage first. Keep privacy settings in force and test the published refresh.

Why other options are worse. Marking both as Public removes protection and may breach policy. Disabling privacy firewall checks is not available in the service. Importing rates manually into Excel creates a stale copy.

4. Import, DirectQuery and Direct Lake

Storage mode defines whether data is copied into the model or queried when the user interacts with a visual.

Import DirectQuery Direct Lake
Data location Compressed copy in the model (VertiPaq) Stays in the source Delta tables in OneLake, loaded in memory as needed
Query speed Typically fast; queries use the in-memory model Depends on source, network, capacity, and design Often close to Import when the workload fits capacity
Data freshness Model reflects the last successful data refresh Source queries run as needed; caching and visual refresh affect what users see Uses the Delta version selected during framing; test data and visual updates
Power Query transforms Broad support; some operations may not fold Use supported foldable transformations Shape data upstream for Direct Lake tables
DAX / feature support Broadest support Some modeling and DAX limitations Check feature support for the Direct Lake variant
Size limits Model memory and capacity limits Source and Power BI limits, such as intermediate result size Guardrails include rows, Parquet files, row groups, and memory
Typical use Most analysis Huge or real-time data, source-level security Fabric lakehouse or warehouse at scale

Key points:

  • Import is a good starting point when the model fits and refresh meets the freshness requirement. It stores a compressed copy and typically gives fast report interactions.

Table tooltip in the Power BI service model view showing Storage mode: Import

  • DirectQuery keeps data at the source. Choose it when the data is too large to import, must be up to date at each interaction, or governance forbids copying. Visuals can trigger source queries; caching affects when queries run. A slow source can slow the report, and some Power Query transformations and DAX features are limited. Verify governance requirements beyond the absence of a full imported copy, including cached results and exports.
  • Direct Lake reads Delta/Parquet files in OneLake directly, without importing them and without translating queries to SQL. It requires Fabric capacity and a supported Fabric source whose data is available as Delta tables. A Direct Lake on SQL analytics endpoints model can fall back to DirectQuery when configuration allows it, for example with a SQL view. Direct Lake on OneLake does not fall back. Check source, security, framing, and capacity for the chosen variant.
  • Dual lets an eligible table act as Import or DirectQuery depending on the query. It often suits shared dimensions when Import and DirectQuery fact tables use the same source group. It stores a copy, so check whether that is permitted.
  • A composite model can mix storage modes or use multiple DirectQuery source groups. Cross-source relationships and security need separate review.

Worked example 2: choosing a storage mode. Scenario. Northwind Logistics stores 200 million shipment events as a Delta table in a Fabric lakehouse. Reports should show events within minutes. The workspace has Fabric capacity, and the table layout fits its Direct Lake guardrails. A prior DirectQuery model was too slow for the reporting workload. What should the analyst do?

Reasoning.

  1. The data is already in a Fabric lakehouse as Delta tables.
  2. The measured Import refresh cannot meet the freshness target for this workload.
  3. The team wants to avoid maintaining a second copy of the fact table.
  4. Direct Lake can load columns from Delta tables into memory as needed. Freshness depends on upstream writes, framing, and how the report refreshes its visuals.
  5. Pilot a Direct Lake semantic model. Check representative queries and the time from a committed source update to a refreshed visual before promising the target.

Why not the others. Import: data is stale between refreshes and may exceed size limits. DirectQuery: the previous implementation missed the performance target; a tuned version would need separate measurement. Dual: changes the behavior of eligible tables in a composite model; it does not meet the stated fact-table requirement by itself.

Exam tip: read for the discriminating requirement. A supported OneLake Delta source and suitable capacity make Direct Lake a candidate. DirectQuery fits a supported source that must be queried without a full import. Import suits workloads that can tolerate the measured refresh interval.

5. Parameters

A Power Query parameter is a named value used in queries. Create it in Transform data → Manage parameters → New parameter, choosing a name, type (Text, Decimal number, Date…), whether it is required, and optionally suggested values. The list helps with authoring; it does not grant or deny access.

Manage parameters dialog with a required Date parameter named StartDate

Typical uses:

  • Switch environments: ServerName and DatabaseName parameters let you move from Dev to Prod by changing an editable parameter in semantic model settings without republishing. Remap the production connection and credentials if needed, then verify the refresh.
  • Dynamic file paths: a FolderPath parameter replaces a hard-coded path.
  • Filtering to limit data: a RowLimit or StartDate parameter keeps the Desktop file small during development and is changed in the service for full loads.
  • Incremental refresh: the case-sensitive Date/Time parameters RangeStart and RangeEnd filter a table’s date/time column. Configure the table policy in Desktop and publish; the service supplies partition-specific boundaries at refresh.

M example using parameters:

M
let
    Source = Sql.Database(ServerName, DatabaseName),
    Sales = Source{[Schema = "dbo", Item = "FactSales"]}[Data],
    Filtered = Table.SelectRows(Sales, each [OrderDate] >= RangeStart and [OrderDate] < RangeEnd)
in
    Filtered

Note >= on one boundary and < on the other; including equality on both boundaries (for example >= RangeStart and <= RangeEnd) can load a boundary row in two adjacent partitions. Use an OrderDate column compatible with the Date/Time parameters and verify that the filter folds to SQL.

Use semantic model settings to edit supported parameter types when you have permission to manage the model. Grayed-out fields are not editable, and Any and Binary types are not supported in the service.

Parameters section of the semantic model settings, where the owner changes StartDate without republishing

6. Pitfalls and exam tips

  • A path on the author’s computer usually is not reachable from the service. Use the appropriate SharePoint or OneDrive cloud connector, or a gateway that can reach a supported shared path.
  • DirectQuery with several slow visuals per page multiplies source queries; reduce visuals, use aggregations, or switch to Import.
  • Updating a source server name means editing Data source settings or a parameter, not rewriting every query.
  • Check privacy levels for the connections used by the published model. Desktop settings do not replace service or gateway configuration.
  • Semantic model live connections cannot be edited in Power Query: the transformations belong in the source model.
  • Exam tip: distractors often mention "increase the refresh frequency" for a freshness requirement; Microsoft documents up to 8 scheduled refreshes per day for Power BI Pro on shared capacity, and up to 48 for PPU, Premium, or Fabric capacity. DirectQuery and Direct Lake avoid a full scheduled import, but data and visuals still have their own update behavior.

Refresh section of the semantic model settings: time zone, refresh schedule, frequency, days and times

7. Mini case study

Case. Adventure Works Bikes has three data sources: an on-premises SQL Server (orders), an Excel workbook on SharePoint (targets, edited monthly by the finance team), and a certified Power BI semantic model owned by HR (headcount). A new sales report must show orders versus targets, and regional managers must also see headcount per region. Performance must be good and HR must keep control of headcount logic and security.

Questions. (1) How do you connect each source? (2) What storage modes? (3) What must be configured for refresh?

Solution.

  1. Orders: use the SQL Server connector in Import mode if the model fits and nightly refresh meets the reporting requirement.
  2. Targets: connect to the SharePoint site with SharePoint Folder, filter to the workbook, and load its table in Import mode. Configure an Organizational account or other approved, supported identity for refresh.
  3. Headcount: if a single model is required and HR permits it, extend the shared HR semantic model with a composite model. The owner needs Build on the upstream model; test viewers’ permissions along the chain and the effect of HR RLS on remote data. Secure local tables separately. If HR prohibits combining the sources, provide an HR-backed thin report instead.
  4. Refresh: map SQL Server to an online on-premises data gateway connection using matching server and database names. Configure SharePoint credentials and privacy levels according to policy, then run a service refresh to verify the mappings. The shared HR model keeps its own refresh and permissions.
  5. Parameters ServerName and DatabaseName support switching SQL environments. Verify that the gateway and credentials match the new values.

Key terms

  • Connector: component that reads a type of source.
  • Semantic model: published data model with relationships, measures and security.
  • Privacy level: classification (Private, Organizational, Public) controlling data sharing between sources.
  • Import / DirectQuery / Direct Lake: storage modes.
  • Composite model: model mixing storage modes or sources.
  • Gateway: bridge to on-premises data.
  • Parameter: reusable named value in Power Query.

Summary checklist

  • I can pick Folder + Combine for many same-shaped files.
  • I reuse shared semantic models and know Build permission is required.
  • I can fix credential and firewall errors with data source settings and privacy levels.
  • I can choose Import, DirectQuery or Direct Lake from the requirements.
  • I can create parameters and use RangeStart/RangeEnd for incremental refresh.

Official sources