70-466 · Question #38
You are developing a SQL Server Analysis Services (SSAS) tabular project. The model includes a table named DimEmployee. The table contains employee details, including the sales territory for each…
The correct answer is B. Add a row filter that implements the LOOKUPVALUE and USERNAME functions. Dynamic row-level security that maps each logged-in AD DS user to their own sales territory requires combining USERNAME() to identify the caller with LOOKUPVALUE() to retrieve the matching territory from the DimEmployee table.
Question
Exhibit
Options
- AAdd a row filter that implements the USERNAME function.
- BAdd a row filter that implements the LOOKUPVALUE and USERNAME functions.
- CAdd a row filter that implements only the CUSTOMDATA function.
- DAdd a row filter that implements the LOOKUPVALUE and CUSTOMDATA functions.
How the community answered
(55 responses)- A7% (4)
- B51% (28)
- C16% (9)
- D25% (14)
Why each option
Dynamic row-level security that maps each logged-in AD DS user to their own sales territory requires combining USERNAME() to identify the caller with LOOKUPVALUE() to retrieve the matching territory from the DimEmployee table.
USERNAME() alone returns the current user's logon name but provides no mechanism to translate that name into a SalesTerritory value, so the filter cannot restrict rows to the correct territory.
USERNAME() returns the domain\logon name of the currently authenticated user, which matches the EmployeeAlias column in DimEmployee. LOOKUPVALUE() then searches that column for the matching alias and returns the corresponding SalesTerritory value, which is used in the row filter expression to restrict each user to only rows belonging to their territory. This combination is the standard DAX pattern for AD DS-based dynamic row-level security in tabular models.
CUSTOMDATA() reads a string passed explicitly in the connection string; it is not populated from AD DS identity and therefore cannot dynamically identify the logged-in user without custom client-side configuration.
LOOKUPVALUE combined with CUSTOMDATA() would require the client application to inject a custom data string per connection rather than relying on AD DS authentication, which does not match the requirement to use the EmployeeAlias AD DS logon.
Concept tested: Dynamic row-level security using USERNAME and LOOKUPVALUE in SSAS tabular
Source: https://learn.microsoft.com/en-us/analysis-services/tabular-models/row-filters-in-tabular-models
Topics
Community Discussion
No community discussion yet for this question.
