0
0
Power BIbi_tool~10 mins

RLS with multiple roles 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 define a role that filters the 'Sales' table by 'Region'.

Power BI
FILTER(Sales, Sales[Region] = [1])
Drag options to blanks, or click blank then click option'
AUSERPRINCIPALNAME()
B"North"
CALL(Sales)
DSUM(Sales[Amount])
Attempts:
3 left
💡 Hint
Common Mistakes
Using USERPRINCIPALNAME() instead of a region name.
Using aggregation functions in the filter condition.
2fill in blank
medium

Complete the DAX expression to filter the 'Sales' table for the current user's email in the 'SalespersonEmail' column.

Power BI
FILTER(Sales, Sales[SalespersonEmail] = [1])
Drag options to blanks, or click blank then click option'
AUSERNAME()
B'user@company.com'
CUSERPRINCIPALNAME()
DCONCATENATE('user@company.com')
Attempts:
3 left
💡 Hint
Common Mistakes
Using USERNAME() which may return domain\username format.
Using a hardcoded email string instead of a function.
3fill in blank
hard

Fix the error in the DAX expression that tries to filter 'Sales' by multiple roles using OR logic.

Power BI
FILTER(Sales, [1](Sales[Region] = "East", Sales[Region] = "West"))
Drag options to blanks, or click blank then click option'
A||
BAND
C&&
DOR
Attempts:
3 left
💡 Hint
Common Mistakes
Using AND instead of OR, which filters for both regions simultaneously (impossible).
Using && which is AND in DAX.
4fill in blank
hard

Fill both blanks to create a DAX filter that allows access if the user is in either the 'Manager' or 'Sales' role.

Power BI
FILTER(Users, [2](Users[Role] = [1], Users[Role] = "Sales"))
Drag options to blanks, or click blank then click option'
A"Manager"
BAND
COR
D"Admin"
Attempts:
3 left
💡 Hint
Common Mistakes
Using AND instead of OR, which requires both roles simultaneously.
Using incorrect role names.
5fill in blank
hard

Fill the blanks to create a DAX expression that filters 'Sales' for users with 'Region' matching their principal name or if USERNAME() = 'Admin'.

Power BI
FILTER(Sales, Sales[Region] = [1] [2] (USERNAME() = "Admin"))
Drag options to blanks, or click blank then click option'
AUSERPRINCIPALNAME()
B&&
C||
DUSEREMAIL()
Attempts:
3 left
💡 Hint
Common Mistakes
Using && instead of || which requires both conditions true.
Using USERNAME() instead of USERPRINCIPALNAME() for email/principal name.
Confusing USEREMAIL() as a valid DAX function.