Siksha Sarovar

Siksha Sarovar (sikshasarovar.com) is a free educational web application that helps students in India learn programming and prepare for academic and competitive exams. The platform offers structured coding courses (C, C++, Python, Java, HTML, CSS, PHP, Power BI, AI, Machine Learning, Data Science), complete university curriculum notes for BCA/MCA students with previous year question papers, Class 10 and Class 12 CBSE/HBSE school notes, and dedicated preparation material for SSC, UPSC, Banking, Railway and other government exams. Browsing the site is completely free and requires no account. Users may optionally sign in with Google solely to save their learning progress, quiz scores and personal preferences across devices.

Privacy Policy | Terms of Service | Contact Siksha Sarovar | About Siksha Sarovar

v4.0.9 · PWA
Siksha Sarovar logo
Siksha Sarovar
Your Learning Universe

Siksha Sarovar is a free e-learning platform for coding courses, BCA university notes and competitive exam preparation. Optional Google sign-in saves your learning progress across devices.

Initializing knowledge base…
Compiling modules 0%

5.8 Testing RLS in Power BI Service

Lesson 48 of 62 in the free Power BI notes on Siksha Sarovar, written by Rohit Jangra.

Testing RLS in Power BI Service

Thorough testing is critical to ensure RLS works correctly. Incorrect configuration can lead to data leaks or users seeing no data at all.

Testing Methods

1. Test in Power BI Desktop (Quick Test)

Steps:

  1. Go to ModelingView as Roles
  2. Select a role to test
  3. Optionally check "Other user" and enter an email (for dynamic RLS)
  4. The report re-renders with the filtered data
  5. Navigate all pages and check every visual
  6. Click Stop viewing to exit

What to Verify: • ✅ Correct rows are visible • ✅ Related tables are also filtered (filter propagation) • ✅ Measures calculate correctly with filtered data • ✅ No data leaks in any visual or page

2. Test in Power BI Service

Steps:

  1. Navigate to the workspace → Click the dataset
  2. Click •••Security
  3. Select a role → Click "Test as role"
  4. The report opens with RLS applied
  5. Verify data visibility across all pages

Test as Specific User:

  1. In the Security pane → Click "Test as" → Enter a user's email
  2. This simulates what that specific user would see
  3. Useful for validating dynamic RLS with different users

Testing Checklist

CheckWhat to Verify
Correct dataUser sees only their authorized rows
No data leaksUnauthorized data is completely hidden
Related tablesFilters propagate through relationships correctly
MeasuresAggregations (SUM, COUNT) reflect filtered data only
No blank reportsUsers assigned to roles can actually see data
Cross-filterClicking on one visual correctly filters others
Drill-throughDrill-through pages respect RLS
ExportExported data (Excel/CSV) is also filtered
Q&ANatural language queries respect RLS
TooltipsTooltip content is filtered by RLS

Common RLS Issues

ProblemCauseSolution
User sees no dataUser not assigned to any roleAssign user to the correct role in Service
User sees all dataUser is workspace Admin/MemberDowngrade to Viewer/Contributor role
Dynamic RLS not workingEmail mismatch (case/format)Ensure data matches exact UPN format
Related table not filteredMissing or wrong relationshipVerify relationship direction and cross-filter
Performance is slowComplex DAX filter expressionSimplify filter, use mapping tables
RLS works in Desktop but not ServiceHaven't assigned users to rolesAssign users in dataset Security settings

Validating Dynamic RLS

For dynamic RLS, test with multiple user accounts:

  1. Test User A: Should see Region = East → Verify ✅
  2. Test User B: Should see Region = West → Verify ✅
  3. Test Manager: Should see all regions → Verify ✅
  4. Test unassigned user: Should see no data (if not in any role) → Verify ✅

Testing with REST API

For automated testing at scale, use the Power BI REST API:

Endpoint: POST /datasets/{datasetId}/executeQueries

With effective identity: • Specify a username and role in the request body • The API returns data as that user would see it • Useful for automated test suites

Best Practices for RLS Testing

Test every role — don't assume one working role means all work • Test with real user accounts — not just "View as Roles" • Check edge cases — users with no role, users in multiple roles • Verify exports — ensure exported data is also filtered • Re-test after model changes — new tables or relationships may break RLS • Document test results — keep a record of what was tested and when