Forum Discussion
Different RLS scenario's for the same user in multiple reports based on the same dataset
- Anonymous2 years ago
Hi, JosKuiper
You might consider leveraging composite models and dataset parameters for a more manageable solution.
While Power BI doesn't support using report names directly in RLS, you can emulate this behavior by using dataset parameters in conjunction with the Power BI service's ability to apply different parameter values for each dataset.
Or build a composite model that combines the original dataset with its parameterized version. This approach allows you to maintain a single source of truth while applying different RLS rules based on the parameter value, which acts as a proxy for the report name.
Define RLS rules to account for parameter values. For example, you can set a parameter that toggles between the HR and Illness scenarios, and use this parameter in a DAX expression to dynamically change the RLS filter.
How to Get Your Question Answered Quickly
Best Regards
Yongkang Hua
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
I was having a similar issue where the same class of users, let's call them XXX, needed to see different slices of the same data in 2 different reports connected to the same semantic model. Meanwhile there are 2 other classes of users, we'll call YYY and ZZZ.
At first I tried making 2 separate RLS tables (1 for XXX, YYY, and ZZZ users with 1 record each for their respective "home" location, and another just for XXX (again) with access to their home location as well as others in the same geographic area).
After reading this post and user JosKuiper's reply I realized I needed to use 1 consolidated RLS table and append to it what I had put in the separate table. Then I needed to add an additional column called [ReportIndex] where value = 1 as filter to use in report A, value = 2 as filter to use in report B. For the class of users XXX that I was having trouble with (the same people needed to follow 2 different sets of RLS rules that were dependent on report they were viewing), since each user would appear as a row in the RLS table multiple times (exactly once for their home location, and 1 or more additional times for sister locations in the same area), I could use the ReportIndex filter to get rid of the overlap between "home location" rules and "sister location" rules.
This is important because the Power BI RLS mechanism automatically assigns the greatest level of privilege to each user in cases where rules overlap each other (i.e. RLS rules are additive and are treated as a union, NOT an intersection). Finally, I applied ReportIndex as a report-level filter in the filter pane of both report A and report B, where index value = 1 and 2, respectively in each. Also noteworthy is that when it comes to the overlap of RLS rules and report filters, the opposite is true: Power BI applies the intersection of the filters (filters are not additive, therefore not a union when multiple filters are applied).
- For RLS: rule A + rule B = A ∪ B privlege for each individual user.
- For report filters: filter X (coming from RLS) + filter Y (coming from report slicer) = X ∩ Y for the end-user browsing the report.
Putting it all together, the lineage looks like this:
I hope this is helpful. Feel free to reply to my comment if anything needs clarification. It worked brilliantly for me with no degradation of performance within the reports themselves!
Very creative solution. I am trying to do the same, but I have two dimensions that RLS will be based on. In your example, the RLS rules consolidated would be related to Location and DimOther1 for my needs. Do you know of way this would work? Everything I can think of leads me to a circular reference.