Forum Discussion
Apply RLS only at the drillthrough level but not on main page
- 4 months ago
thanks for the reply. I was able to do this without having two semantic models. I followed the instructions stated in the other responses to this post, and it is working.
Hi ldwf ,
RLS is applied to the full semantic model so you cannot set it to have a specific page visualization based on the RLS. What you can do is to apply a specific filter to that page based on the user profile.
Not sure how you have the user / coutry table but you need to have the email for the login to be picked up.
I have the following model:
Creating the following measure:
Filter Country by user =
VAR _userCountry =
SELECTCOLUMNS(
CALCULATETABLE('Country/Users', 'Country/Users'[User] =USERPRINCIPALNAME()),
"Country", 'Country/Users'[Country])
RETURN
COUNTROWS(
FILTER(Countries,
Countries[Country] in _userCountry)
)
No just add this on the visualizations of the detail page has a filter this should give expected result:
Has you can see the user will only see the countries they have access to.
Thanks for the response. I did create a measure based filter using the USERPRINCIPALNAME() but did not leave it as a stand alone table. I joined it to the table that sources the visual on the drillthrough page based on the country value. I applied the measure to the visuals on the detail page. I logged in as various users and tested it out and it works