MICROSOFT POWER BI • CONNECTING TO DATA

Credentials & Privacy Levels — Set credentials and privacy levels appropriately (conceptual)

Understanding how authentication credentials and privacy levels govern secure, correct data integration in Power BI.

Historical Context & Motivation

The challenge of securely connecting analytical tools to heterogeneous data sources is as old as the client-server model itself. When organizations first began pulling data from remote databases in the 1990s, ODBC drivers required users to embed plaintext credentials directly into connection strings—an approach that, while functional, created serious security vulnerabilities. As data warehousing matured and self-service BI platforms emerged in the 2000s and 2010s, the problem intensified: analysts now routinely combine data from cloud APIs, on-premises databases, flat files, and SaaS platforms within a single report, each source carrying its own authentication scheme and sensitivity classification.

Microsoft Power BI, released in 2015 as a unified self-service analytics platform, inherited this complexity and introduced two complementary abstractions to manage it: data source credentials and privacy levels. Credentials govern who can authenticate against a data source and under what identity context. Privacy levels govern how the mashup engine may combine data from different sources, preventing inadvertent information leakage. Together, these mechanisms enforce the principle of least privilege while enabling flexible data integration—a design heavily influenced by earlier work in the Power Query (M) language engine and the on-premises data gateway architecture.

1992
ODBC Standardization
Microsoft publishes the ODBC API, establishing connection strings with embedded credentials as the de facto standard for database connectivity in Windows-based analytics tools.
2010
Power Query Inception
Microsoft begins developing the M language and Power Query engine for Excel, introducing the concept of data source privacy levels to control cross-source query folding and data merging.
2015
Power BI Desktop GA
Power BI Desktop reaches general availability, inheriting Power Query's credential and privacy-level framework while adding OAuth 2.0 and organizational account support for cloud sources.
2017
On-Premises Data Gateway v2
The redesigned gateway enables centralized credential management in the Power BI Service, decoupling authentication from individual report authors and supporting Kerberos-constrained delegation for single sign-on.
2023
Fabric & Unified Credentials
Microsoft Fabric introduces unified cloud connections and managed identities, further abstracting credential management and making privacy-level enforcement consistent across lakehouses, warehouses, and semantic models.

The fundamental question this lesson addresses is: How do you configure credentials and privacy levels in Power BI so that data connections are both secure and functionally correct, preventing unauthorized access on one hand and unintended data leakage during query evaluation on the other? Understanding these mechanisms conceptually is essential before you ever open the Data Source Settings dialog, because misconfiguration can silently produce incomplete query results or expose sensitive records across trust boundaries.

Core Principles & Definitions

Before diving into configuration details, it is important to establish the foundational concepts that underpin Power BI's approach to secure data connectivity. The system distinguishes between two orthogonal concerns: authentication (proving identity to a data source) and data isolation (controlling how data from different sources may be combined during query evaluation). These two concerns map directly onto credentials and privacy levels, respectively.

1

Data Source Credentials

The authentication method and identity token Power BI uses to connect to a data source. Options include Anonymous, Windows, Database (SQL auth), Organizational Account (OAuth / Azure AD), and Key / API Token.
2

Privacy Levels

A per-source sensitivity classification—Private, Organizational, or Public—that tells the Power Query mashup engine which sources may be merged or folded together during evaluation.
3

Query Folding

The optimization where Power Query translates M transformations into native source queries (e.g., SQL). Privacy levels may prevent folding across sources if the combination would violate isolation constraints, triggering local evaluation or a firewall error.
4

Credential Scope

Credentials in Power BI are scoped to the data source path—a combination of connector type, server address, and database name. All queries sharing the same path share the same credential, a design that simplifies management but demands awareness of path granularity.
5

Data Source Settings vs. Gateway Configuration

In Power BI Desktop, credentials and privacy levels are set in File > Options > Data Source Settings. In the Power BI Service, they are managed per dataset or via the on-premises data gateway admin portal, often with different auth options.
KEY TAKEAWAY
Think of credentials and privacy levels like a building's security system. Credentials are your badge that gets you through the door—they prove who you are. Privacy levels are the room-classification labels (public lobby, employee-only floor, restricted vault) that determine which rooms' contents can be combined in the same briefing. Even if your badge opens every door, the classification rules prevent you from mixing vault documents into a public-lobby presentation.

Visual Explanation — Credential & Privacy Architecture

This diagram illustrates the three-layer architecture. Data sources (left) each require a specific credential type (center) for authentication. Each source is independently assigned a privacy level (right). The mashup engine enforces firewall rules before producing the merged semantic model. Incompatible privacy-level combinations trigger a firewall error rather than silently proceeding.

The visual above clarifies a common source of confusion: credentials and privacy levels operate at different layers and serve fundamentally different purposes. Credentials are negotiated at connection time between the Power Query engine and the external data source—they are about identity and access. Privacy levels, on the other hand, are enforced at query evaluation time within the mashup engine—they are about data isolation and information flow control. You can think of the mashup engine as an intermediary that first authenticates to each source using the configured credentials, then checks privacy-level compatibility before combining any data. If the privacy levels are incompatible (for example, merging a Private source's values into a query sent to a Public source), the engine raises a Formula.Firewall error, which prevents the query from completing.

How Credentials & Privacy Levels Work

Credential Resolution Process

When Power Query encounters a data access function such as Sql.Database("server", "db") or Web.Contents("https://api.example.com"), it derives a data source path from the function's arguments. This path serves as the lookup key into the credential store. The engine searches for a stored credential whose scope matches or is a prefix of the derived path. If no credential is found, Power BI prompts the user to supply one. Critically, the path determines credential granularity: connecting to Sql.Database("server1", "Sales") and Sql.Database("server1", "HR") may share a single server-level credential or require separate database-level credentials, depending on how the user has scoped them.

Authentication Method Taxonomy

Common authentication methods in Power BI and their identity providers
Auth MethodIdentity ProviderToken TypeTypical Sources
AnonymousNoneNo token sentPublic REST APIs, open data portals
WindowsActive Directory / local SAMNTLM or Kerberos ticketSQL Server (Windows Auth), file shares
DatabaseSource-native user storeUsername + passwordSQL Server (SQL Auth), MySQL, PostgreSQL
Organizational AccountAzure AD / Microsoft Entra IDOAuth 2.0 bearer tokenSharePoint, Dataverse, Azure SQL, Power BI dataflows
Service Principal / KeyAzure AD App RegistrationClient credential / API keyAzure services, third-party APIs

Privacy Level Firewall Logic

The Power Query firewall partitions all data source references in a query into firewall partitions based on their data source paths. Each partition is assigned the privacy level configured for that source. Before the engine sends any data from one partition into a query targeting another partition, it checks a compatibility matrix. The core rule can be expressed concisely: data may flow from a less-restrictive level into a more-restrictive context, but never from a more-restrictive level into a less-restrictive one. Formally, if we assign ordinal values—Private = 3, Organizational = 2, Public = 1—then a merge of source A into source B is permitted only if level(A) ≤ level(B) or if both sources share the same partition. When the condition is violated, the engine blocks the query with a Formula.Firewall error.

PRIVACY LEVEL COMPATIBILITY RULE
Merge(A, B) is allowed ⟺ privacyLevel(A) ≤ privacyLevel(B)
Where privacyLevel is an ordinal: Public = 1, Organizational = 2, Private = 3. Data flows upward (toward more restrictive) but never downward.
Special Case: "None" Privacy Level
If a source has no privacy level assigned (the 'None' state), Power BI Desktop will prompt you at query evaluation time to assign one. In the Power BI Service, unassigned levels default to Private for safety, which can silently prevent cross-source merges that worked in Desktop. This is a common source of 'it works locally but fails on publish' bugs.

Privacy Level Compatibility Matrix & Classification

The interaction between privacy levels is best understood through a compatibility matrix. When Power Query evaluates a query that combines two data sources, it looks up their assigned privacy levels and determines whether the combination is allowed, buffered (data is pulled locally first to prevent query folding across sources), or blocked. The following table and diagram make this explicit.

Privacy Level Compatibility Matrix — how two sources interact when merged
Source A ↓ / Source B →PublicOrganizationalPrivate
Public✓ Allowed✓ Allowed✗ Blocked
Organizational✗ Blocked✓ Allowed✗ Blocked
Private✗ Blocked✗ Blocked⚠ Isolated

Several important subtleties emerge from this matrix. First, Private sources are completely isolated: they can never share data with any other source, and even merging two Private sources from different paths is blocked. This is by design—Private is intended for sources containing highly sensitive data such as employee salaries or patient records, where no cross-source leakage is tolerable. Second, Organizational sources can merge with other Organizational sources and can receive data from Public sources, but cannot send data to Public sources. This models the typical enterprise scenario where internal data can incorporate public reference data but should not be exposed to external APIs. Third, Public sources are the most permissive: they can be merged with anything except Private.

Data flow rules between privacy levels. Public data may flow into Organizational contexts (green arrow) but Organizational data cannot flow outward to Public endpoints (red arrow). Private sources are completely isolated from all other sources, regardless of direction.
💡 The "Ignore Privacy Levels" Escape Hatch
Power BI Desktop offers a global option under File > Options > Privacy to 'Always ignore Privacy Level settings.' This disables the firewall entirely, which eliminates Formula.Firewall errors but removes all data isolation guarantees. This option is appropriate only for personal development with non-sensitive data. It is never available in the Power BI Service—published datasets always enforce privacy levels.

Worked Example — Configuring a Multi-Source Report

Consider the following scenario: you are building a Power BI report that combines employee data from an on-premises SQL Server database with exchange rate data from a public REST API and departmental budget information from a SharePoint Online list. Each source has different authentication requirements and data sensitivity. Let us walk through the correct configuration.

Configuring Credentials & Privacy Levels for a Multi-Source Report
1
Step 1 — Inventory Data Sources and Their SensitivityBegin by listing every data source the report will connect to, along with the sensitivity of the data it contains. Source A is Sql.Database("hrserver.corp.local", "EmployeeDB") — this contains employee names, salaries, and SSNs, making it highly sensitive. Source B is Web.Contents("https://api.exchangerate.host/latest") — a public, freely accessible API with no authentication requirement. Source C is SharePoint.Tables("https://contoso.sharepoint.com/sites/finance") — an internal SharePoint site containing departmental budgets, accessible only to organizational users.
Three sources identified: SQL Server (highly sensitive), REST API (public), SharePoint (organizational).
2
Step 2 — Assign Credential TypesFor Source A (SQL Server), choose Windows authentication to leverage the existing Active Directory infrastructure and avoid storing SQL passwords. For Source B (REST API), select Anonymous because no token is required. For Source C (SharePoint), use Organizational Account and sign in with your Azure AD credentials, which generates an OAuth 2.0 bearer token. In Power BI Desktop, go to File > Options > Data Source Settings, select each source, and click 'Edit Permissions' to configure these.
SQL Server → Windows | REST API → Anonymous | SharePoint → Organizational Account
3
Step 3 — Assign Privacy Levels Based on Data SensitivitySource A (EmployeeDB) contains PII, so assign it the Private privacy level. Source B (exchange rate API) is publicly available data, so assign Public. Source C (SharePoint budgets) is internal corporate data, so assign Organizational. These are set in the same 'Edit Permissions' dialog under the 'Privacy Level' dropdown.
EmployeeDB → Private | Exchange Rate API → Public | SharePoint → Organizational
4
Step 4 — Evaluate Query Design Against Privacy ConstraintsNow consider what merges your report requires. You want to join budget data (Organizational) with exchange rates (Public) to convert budgets to a common currency. Checking the matrix: Public → Organizational is allowed. However, you also want to merge employee salary data (Private) with budget allocations (Organizational). Checking the matrix: Private ↔ Organizational is blocked. This merge will produce a Formula.Firewall error.
Budget ⨝ Exchange Rates → ✓ Allowed | Salaries ⨝ Budgets → ✗ Blocked
5
Step 5 — Resolve the Conflict by Reconsidering Privacy LevelsTo resolve the blocked merge, you have several options. If the salary data being used in the merge is aggregated (e.g., total department salary rather than individual records), you might reclassify the EmployeeDB source as Organizational instead of Private—but only if the aggregation is done within the source query before any merge. Alternatively, you could load the salary and budget data independently into the semantic model and perform the join using DAX relationships rather than Power Query merges, since privacy-level enforcement applies only to the Power Query evaluation phase. A third option is to restructure the data pipeline so that the sensitive data is pre-aggregated in a staging view on the SQL Server, then connect to that view as an Organizational source.
Resolution: Use DAX relationships or pre-aggregate sensitive data to avoid cross-privacy-level merges in Power Query.

Strengths, Limitations & Common Pitfalls

Strengths and limitations of Power BI's credential and privacy-level system
AspectStrengthsLimitations / Pitfalls
Security PosturePrivacy levels provide defense-in-depth against unintentional data leakage across source boundaries, complementing network and identity controls.The system cannot detect sensitivity within a source—if a single SQL Server database contains both public and private tables, the privacy level applies uniformly to the entire source path.
UsabilityCredential dialogs in Desktop are intuitive; OAuth flows use standard browser-based consent. Settings persist across sessions.Formula.Firewall errors are notoriously opaque—error messages do not specify which sources conflict. Debugging requires manually checking all source-level privacy assignments.
PerformanceWhen privacy levels permit query folding, transformations execute on the source, minimizing data transfer.Strict privacy levels can force the engine to buffer data locally instead of folding, causing significant performance degradation on large datasets.
Desktop vs. Service ParityBoth environments support the same privacy-level semantics, ensuring consistent behavior.Desktop allows 'Ignore Privacy Levels' for development; Service does not. Credentials set in Desktop do not transfer to Service—they must be reconfigured after publishing.
GovernanceGateway-managed credentials enable centralized control; admins can enforce credential policies across the organization.Self-service users may set incorrect privacy levels without realizing it, either over-restricting (blocking valid merges) or under-restricting (allowing leakage).
KEY TAKEAWAY
The privacy-level system in Power BI is analogous to mandatory access control (MAC) in operating systems like SELinux: every data source is labeled, and the engine enforces information-flow policies based on those labels regardless of the user's intent. Just as a process with a 'Secret' classification cannot write to an 'Unclassified' file in a MAC system, a Private data source cannot send filter values to a Public endpoint in Power Query. Understanding this analogy helps you reason about why certain merges are blocked and how to architect queries that respect these boundaries.

Connection to Advanced Architecture & Future Directions

The conceptual framework of credentials and privacy levels in Power BI Desktop is the starting point for a broader set of enterprise-grade data governance capabilities. As you move from self-service Desktop reports to production-grade deployments in the Power BI Service and Microsoft Fabric, several advanced mechanisms build upon these foundations.

How foundational credential and privacy concepts extend into enterprise governance
Concept (This Lesson)Advanced ExtensionWhere It Applies
Manual credential entry in DesktopManaged Identities & Service Principals — Azure-managed credentials that eliminate secret storagePower BI Service, Fabric pipelines, Azure Data Factory
Per-source privacy levelsSensitivity Labels (Microsoft Purview) — organization-wide classification that persists through exportPower BI Service, Microsoft 365, Fabric
Windows auth for on-prem sourcesKerberos Constrained Delegation (KCD) — enables SSO through the gateway using the report viewer's identityOn-premises data gateway
Credential scope = data source pathCloud Connections — shareable, centrally managed connection objects in FabricMicrosoft Fabric workspace
"Ignore Privacy Levels" optionTenant-Level Governance Policies — admins can enforce or lock privacy-level settings across the entire organizationPower BI Admin Portal

As you progress into data engineering and enterprise BI architecture, you will encounter scenarios where the simple three-tier privacy model is insufficient—for example, when a single lakehouse contains data at multiple classification levels, or when row-level security (RLS) must interact with privacy levels. Microsoft Fabric's unified architecture is beginning to address these gaps by introducing workspace-level trust boundaries and managed VNet gateways that enforce network isolation in addition to logical privacy levels. Understanding the foundational concepts in this lesson will make these advanced patterns much more tractable.

Practice Problems

PROBLEM 1CONCEPTUAL
Explain the fundamental difference between credentials and privacy levels in Power BI. Why are both necessary—could one mechanism alone provide adequate security for data integration?
PROBLEM 2BASIC CALCULATION
A Power BI report connects to three sources: Source X (privacy level = Organizational), Source Y (privacy level = Public), and Source Z (privacy level = Private). Using the compatibility rule privacyLevel(A) ≤ privacyLevel(B), determine which of the following merges are allowed: (a) Y into X, (b) X into Y, (c) X into Z, (d) Z into X.
PROBLEM 3INTERMEDIATE
You have a Power Query step that merges a SharePoint list (Organizational) with a SQL Server database (Organizational) and then uses the merged result to filter a call to a Web API (Public). Despite all sources having seemingly compatible levels, you receive a Formula.Firewall error. Explain why this might occur and propose two different solutions.
PROBLEM 4APPLIED
You are deploying a Power BI report to the Service that uses Windows authentication against an on-premises SQL Server. In Desktop, the report refreshes correctly. After publishing, scheduled refresh fails with a credentials error. Describe the most likely cause and outline the steps to resolve it, including the role of the on-premises data gateway.
PROBLEM 5CRITICAL THINKING
Power BI's privacy-level system assigns a single classification to an entire data source path. Critically evaluate this design choice from an information-security perspective. What are its shortcomings compared to column-level or row-level sensitivity classification? Propose an architectural extension that could address these shortcomings while remaining backward-compatible with the existing model.

Lesson Summary

Power BI's approach to secure data connectivity rests on two complementary mechanisms. Data source credentials—including Anonymous, Windows, Database, and Organizational Account methods—govern authentication, proving identity to each data source. These credentials are scoped to data source paths and must be configured separately in Power BI Desktop (via Data Source Settings) and the Power BI Service (via gateway or dataset settings).

Privacy levelsPublic, Organizational, and Private—govern data isolation by telling the Power Query mashup engine which sources may be merged during evaluation. The firewall enforces a compatibility matrix: Public data can flow into Organizational contexts, but Private sources are fully isolated, and Organizational data cannot flow outward to Public endpoints. Misconfigured privacy levels produce Formula.Firewall errors or, if the 'Ignore Privacy Levels' option is enabled in Desktop, risk silent data leakage. Mastering both credentials and privacy levels is essential for building reports that are secure by design and behave consistently from development through production deployment.

Varsity Tutors • Microsoft Power BI • Credentials & Privacy Levels