0
0
Power BIbi_tool~10 mins

Testing RLS in Desktop 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 code to define a role filter for the 'Region' column.

Power BI
FILTER('Sales', 'Sales'[Region] = [1])
Drag options to blanks, or click blank then click option'
A"East"
B"South"
C"North"
D"West"
Attempts:
3 left
💡 Hint
Common Mistakes
Forgetting to put quotes around the region name.
Using a column name instead of a string value.
2fill in blank
medium

Complete the DAX expression to create a calculated table for RLS testing.

Power BI
TestTable = FILTER(ALL('Sales'), 'Sales'[Country] = [1])
Drag options to blanks, or click blank then click option'
A"USA"
B"Canada"
C"Mexico"
D"Brazil"
Attempts:
3 left
💡 Hint
Common Mistakes
Not using ALL to remove filters.
Using a column reference instead of a string.
3fill in blank
hard

Fix the error in the DAX expression for role filter.

Power BI
FILTER('Sales', 'Sales'[Year] [1] 2023)
Drag options to blanks, or click blank then click option'
A>=
B==
C=>
D=
Attempts:
3 left
💡 Hint
Common Mistakes
Using '==' instead of '=' for equality.
Reversing the operator symbols.
4fill in blank
hard

Fill both blanks to create a DAX role filter that limits data to the current user and year.

Power BI
FILTER('Sales', 'Sales'[UserEmail] = USERPRINCIPALNAME() && 'Sales'[Year] [1] [2])
Drag options to blanks, or click blank then click option'
A=
B2024
C>=
D<=
Attempts:
3 left
💡 Hint
Common Mistakes
Using logical OR instead of AND.
Using incorrect comparison operators.
5fill in blank
hard

Fill all three blanks to create a DAX measure that counts sales filtered by user and region.

Power BI
SalesCount = CALCULATE(COUNTROWS('Sales'), FILTER('Sales', 'Sales'[UserEmail] = [1] && 'Sales'[Region] = [2] && 'Sales'[Year] [3] 2023))
Drag options to blanks, or click blank then click option'
AUSERPRINCIPALNAME()
B"East"
C=
D>=
Attempts:
3 left
💡 Hint
Common Mistakes
Using quotes around USERPRINCIPALNAME().
Using wrong comparison operators.