0
0
Power BIbi_tool~10 mins

Dynamic RLS with USERNAME in Power BI - Interactive Code Practice

Choose your learning style9 modes available
Practice - 5 Tasks
Answer the questions below
1fill in blank
easy

Complete the DAX expression to get the current user's username.

Power BI
CurrentUser = [1]()
Drag options to blanks, or click blank then click option'
AUSEREMAIL
BUSERPRINCIPALNAME
CUSERNAME
DUSERID
Attempts:
3 left
💡 Hint
Common Mistakes
Using USERPRINCIPALNAME() instead of USERNAME()
Trying to use USEREMAIL() which is not a valid DAX function
Using USERID() which does not exist in DAX
2fill in blank
medium

Complete the FILTER expression to restrict data to rows where the 'Salesperson' column matches the current user.

Power BI
FILTER(Sales, Sales[Salesperson] = [1]())
Drag options to blanks, or click blank then click option'
AUSERNAME
BCURRENTUSER
CUSERPRINCIPALNAME
DUSEREMAIL
Attempts:
3 left
💡 Hint
Common Mistakes
Using USERPRINCIPALNAME() which returns email format and may not match 'Salesperson' values
Using a non-existent function CURRENTUSER()
Using USEREMAIL() which is invalid in DAX
3fill in blank
hard

Fix the error in the DAX expression to correctly filter rows for dynamic RLS.

Power BI
FILTER(Employees, Employees[Username] = [1])
Drag options to blanks, or click blank then click option'
AUSERNAME()
BUSERNAME
CUSERPRINCIPALNAME()
DCURRENTUSER()
Attempts:
3 left
💡 Hint
Common Mistakes
Omitting parentheses after USERNAME
Using USERPRINCIPALNAME() which might not match the 'Username' column format
Using a non-existent function CURRENTUSER()
4fill in blank
hard

Fill both blanks to create a DAX filter that allows access only if the current user matches the 'UserEmail' column.

Power BI
FILTER(Users, Users[UserEmail] = [1]() && [2](Users[UserEmail], 12) = "@company.com")
Drag options to blanks, or click blank then click option'
AUSERPRINCIPALNAME
BUSERNAME
CRIGHT
DLEFT
Attempts:
3 left
💡 Hint
Common Mistakes
Using USERNAME() which returns username, not email
Using LEFT instead of RIGHT to check email domain
Omitting parentheses after USERPRINCIPALNAME
5fill in blank
hard

Fill all three blanks to create a DAX expression that filters the 'Sales' table for rows where the 'Region' matches the user's region stored in a 'UserRegion' table.

Power BI
FILTER(Sales, Sales[Region] = RELATED([1][[2]]) && RELATED([1][Email]) = [3]())
Drag options to blanks, or click blank then click option'
AUserRegion
BRegionName
CUSERNAME
DUSERPRINCIPALNAME
Attempts:
3 left
💡 Hint
Common Mistakes
Using USERNAME instead of USERPRINCIPALNAME for email comparison
Swapping table and column names
Omitting parentheses after USERPRINCIPALNAME