Table-level security in Power BI lets you restrict access to specific rows or columns in a dataset, ensuring users only see data relevant to them. It works by applying DAX filter expressions to tables in your data model, enforced at query time. To use it, you must have a dataset published to the Power BI service—row-level security (RLS) rules defined in Power BI Desktop won’t apply until published and configured in the service. You’ll also need appropriate permissions: either dataset‘ ownership’ or ‘admin’ rights in the workspace.
What You’ll Need
- A Power BI Pro or Premium capacity workspace (RLS requires a Pro or PPU/EM SKU)
- Dataset created in Power BI Desktop (or imported into Power BI service)
- A user or security group in Azure Active Directory to assign roles to
- Admin or member permissions in the workspace containing the dataset
- Underlying data model with clear user-identifying columns (e.g., Email, Department, Region)
Step-by-Step
- Open Power BI Desktop and load your dataset. Ensure your data model includes a column that uniquely identifies users—commonly an
EmailorUserName()matching field. For example, if your sales table has aSalesRepEmailcolumn, that’s ideal for row-level filtering. - Define a role in Power BI Desktop. Go to the Model view (or switch to Modeling tab), then click Manage Roles. Click New, name the role (e.g.,
RegionalManager), and in the Table dropdown, select the table you want to secure (e.g.,Sales). In the Filter row box, enter a DAX expression like:[SalesRepEmail] = USERPRINCIPALNAME()or[Region] = "North"for static filtering. This expression determines which rows appear to users assigned to this role. - Test the role before publishing. In Power BI Desktop, click the View As button (in the Modeling tab) and select your newly created role. Power BI will simulate how the data appears to a user in that role—verify only the intended rows show up. If your filter uses
USERPRINCIPALNAME(), enter your actual email when prompted to test accurately. - Publish the dataset to the Power BI service. Go to File > Publish > Publish to Power BI, select your workspace, and confirm the publish. Note: RLS roles defined in Desktop *must* be republished to take effect—even minor DAX edits require republishing.
- Assign users to roles in the service. In the Power BI service, open the workspace, go to your dataset, click the three dots (...) > Settings. Under Row-level security, click Apply next to the role you created. Then click Add members and select Azure AD users or groups. Ensure the group or user’s email matches the value used in your DAX expression (e.g., if using
USERPRINCIPALNAME(), the member’s sign-in email must match the column value exactly). - Verify role assignment. Have a test user open the report or dataset. In the Power BI service, click File > Options and settings > Options > Security to see which roles are active for your session. Also, use View As on the dataset page (gear icon > View As) to simulate any assigned user and confirm filtering works correctly.
Common Mistakes
- Not republishing after edits: Changes to DAX filters in Desktop won’t apply until republished. Many assume saving in Desktop is enough—this is false.
- Mismatched user identifiers: Using
USERNAME()instead ofUSERPRINCIPALNAME()can cause failures, especially in guest accounts or when email formats differ.USERPRINCIPALNAME()is more reliable for email-based matching. - Ignoring table dependencies: If you apply RLS to a fact table but not its dimension tables (e.g., filtering
Salesbut notProducts), users may see inconsistent data (e.g., sales for filtered products only, but all product names). Apply filters consistently across related tables. - Assuming column-level security works like row-level: Power BI does *not* support true column-level RLS. You can’t hide columns via RLS—only filter rows. To restrict columns, use row-level security combined with report-level visuals or hide columns in the model (but this affects all users).
- Overlooking role inheritance in groups: If assigning to an Azure AD security group, ensure the user is a *direct* member (nested groups may not resolve correctly depending on your tenant settings).
Tips
- Use parameterized filters for flexibility: Instead of hardcoding regions, create a parameter table (e.g.,
RegionMap) with columnsRegionandAllowedUserEmail, then filter with:[Region] IN SELECTCOLUMNS(FILTER(RegionMap, [AllowedUserEmail] = USERPRINCIPALNAME()), "Region", [Region]). - Combine with row-level security for hierarchy: For org charts, use
PATHCONTAINS()with aManagerEmailcolumn:[ManagerEmail] = USERPRINCIPALNAME() || [Email] = USERPRINCIPALNAME()to show subordinates. - Enable auditing: In Power BI Admin portal, turn on Dataset access audit logs to track who accessed which data—critical for compliance.
- Test with guest users: If using Azure AD B2B, test with an actual guest account—some expressions like
USERNAME()return the guest’s UPN with a suffix (e.g.,user_outlook.com#EXT#@tenant.onmicrosoft.com), which breaks direct equality matches. - Use static test data for validation: Create a small test dataset with known users and values to isolate RLS logic before applying to production.
Troubleshooting
If RLS isn’t working as expected, follow this sequence:
- Confirm permissions: The user must have *read* access to the report/dataset. If they see a blank report, check if they’re in the role *and* have workspace access.
- Recheck the DAX expression: Syntax errors won’t show until publish. Reopen Power BI Desktop, go to Manage Roles > Edit, and validate syntax using the Test button (if available). Common fixes: add semicolons, ensure column names use brackets, and avoid typos (case-sensitive in some models).
- Verify data type consistency: If filtering on
Region, ensure both the column and filter value are text. A mismatch like[Region] = "North"vs. numeric 1 causes silent failures. - Inspect active roles: In Power BI service, open the report, click the profile icon > View as, and select the role. If data is still unfiltered, the role isn’t applied—reassign it under dataset > Settings > RLS.
- Check for query overrides: If using DirectQuery, ensure the underlying database doesn’t have its own row-level security (e.g., SQL Server RLS), which can conflict with Power BI’s filters. In DirectQuery, Power BI appends its filter *after* the database filter.
- Restart the dataset cache: For imported models, go to dataset > Settings > Refresh schedule and trigger a manual refresh. Cached results may retain old row sets.
Frequently Asked Questions
Can I use RLS with paginated reports?
No. Paginated reports in Power BI don’t support row-level security. You must use Power BI reports or export to PDF/Excel and apply security externally.Does RLS work in Power BI Embedded or Power BI Premium Per User?
Yes—RLS functions identically in Premium Per User (PPU), Premium Capacity (EM/PP), and Pro workspaces. The only requirement is the workspace uses a Pro or Premium capacity SKU.Can I apply multiple roles to one user?
No. Each user can be assigned to *only one* RLS role at a time. For overlapping access (e.g., both North and South regions), define a single role with inclusive logic like:[Region] IN {"North", "South"}.
Why does my test user still see all rows?
Most commonly: (1) the role isn’t assigned in the *service*, (2) the dataset wasn’t republished after role creation, or (3) the DAX expression usesUSERNAME() but the user’s sign-in email doesn’t match the column value (e.g., due to alias changes). Always use USERPRINCIPALNAME() for reliability.
Does RLS apply to direct query data sources?
Yes, but Power BI passes the RLS filter as aWHERE clause to the database. Ensure your data source supports this and that the user’s credentials (or service principal) have permissions to read the filtered rows.