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.
RLS in Power BI is applied at the dataset level, so it is enforced everywhere those tables are used. There is no built-in way to scope RLS to a single page or to drillthrough only.
For this case I would skip RLS on the model and instead use a measure-based page-level filter on the detail page only. The measure compares the visual's country to the country the user is allowed to see, looking up USERPRINCIPALNAME() against your user-to-country mapping table. Keep that mapping table standalone, with no relationship to the fact table, so it does not propagate any filter to the main page.
The main page then stays unfiltered for everyone, and the detail page only shows the rows for the signed-in user's country.
If this works for you, kindly mark it as the solution and give a thumbs up.
Best regards,
Shai Karmani
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