0
0
Power BIbi_tool~10 mins

Managing RLS in Service in Power BI - Cell-by-Cell Formula Trace

Choose your learning style9 modes available
Sample Data

This table shows users and their assigned regions for Row-Level Security (RLS) in Power BI Service.

CellValue
A1User
B1Region
A2Alice
B2North
A3Bob
B3South
A4Carol
B4East
A5Dave
B5West
Formula Trace
USERNAME() = "Alice" && [Region] = "North"
Step 1: USERNAME()
Step 2: [Region]
Step 3: USERNAME() = "Alice"
Step 4: [Region] = "North"
Step 5: TRUE && TRUE
Cell Reference Map
    A       B
1 | User  | Region
2 | Alice | North  <-- USERNAME() matches 'Alice', Region is 'North'
3 | Bob   | South
4 | Carol | East
5 | Dave  | West
The formula uses USERNAME() to get the current user and compares it to 'Alice'. It also checks the Region column in the current row.
Result
    A       B
1 | User  | Region
2 | Alice | North  <-- Visible to Alice
3 | Bob   | South  <-- Not visible to Alice
4 | Carol | East   <-- Not visible to Alice
5 | Dave  | West   <-- Not visible to Alice
Because the RLS rule allows only rows where USERNAME() is 'Alice' and Region is 'North', Alice sees only her row.
Sheet Trace Quiz - 3 Questions
Test your understanding
What does USERNAME() return in the formula?
AThe region name
BThe table name
CThe current logged-in user name
DThe current date
Key Result
RLS filters rows by checking if USERNAME() matches the user and the row's attribute matches the allowed value.