Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

To celebrate FabCon Vienna, we are offering 50% off select exams. Ends October 3rd. Request your discount now.

Reply
JosKuiper
New Member

Different RLS scenario's for the same user in multiple reports based on the same dataset

Hello Community,

 

I'm looking for the most efficient way to get the following scenario working out the right way:

 

I have two reports, HR and Illness, both are based on the same dataset, with a live connection, named HR dataset. We do dynamic RLS based on the logged on user with the userprincipalname(). The RLS is comming from a table called [RLS_Table] (example). The RLS filtered fact table is [Fct_Table]. In my model there are some dimension tables between them but for this post they are not relevant. 

 

Datamodel.png

 

 

 

I have a user who is allowed to see alle rows in [Fct_Table] for the Illness report, but is not allowed to see all rows in [Fct_Table] for the HR report. The RLS is filtered based on [Organization Unit]. Example tables:

 

[Fct_Table]

DateEmployeeOrganization UnitHours
4/1/20241123AAA8
4/2/20241123AAA7
4/3/20241123AAA0
4/4/20241123AAA8
4/1/20241456BBB2
4/2/20241456BBB5
4/3/20241456BBB8
4/4/20241456BBB8
4/1/20241789BBB6
4/2/20241789BBB8
4/3/20241789BBB5
4/4/20241789BBB8

 

[RLS_Table]

Organization UnitUserprincipalnameReport
AAAtestuser@example.comHR
AAAtestuser@example.comIllness
BBBtestuser@example.comIllness
CCCtestuser@example.comIllness
DDDtestuser@example.comIllness

 

In this example user testuser@example.com should see rows with [Organization Unit] = 'AAA' in the HR report and should see rows with [Organization Unit] = 'AAA','BBB','CCC','DDD' in the Illness report.

 

I'm able to solve this but i'm looking for the most efficient solution. Our prefered solution doesn't seem to be possible. Solution we have are:

1. We would like to know which report the user is currently using so that we can do RLS filtering on column [Userprincipalname] and [Report]. It looks like its not possible to use a variable/ parameter to know which report is used... Is there a way to do this?

2. We can split the RLS and FCT tables in the model with a reference to the orignal tables. We then also have to split the permission  roles in the dataset. If we filter the RLS on report level we get a working solution but have to define all measures we use in both reports twice. See Scenario 2 image.

3. We can make two seperate datasets, but the downside of that solution is that we have to do all optimization and changes twice. The risks of difference between the models is big.

 

Scenario 2 image:

Datamodel scenario 2.png

 

What are the best/ good practices for our scenario? We are looking for the most efficient way to solve this. In our opinion the optimal solution would but be to have a report variable with the report name, but it doesn't seem available.

 

Thanks in advance!

1 ACCEPTED SOLUTION
Anonymous
Not applicable

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.

View solution in original post

5 REPLIES 5
mjc543
Advocate II
Advocate II

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:

 

mjc543_8-1723664090919.png

 

 

mjc543_9-1723664099363.png

 

 

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.

Anonymous
Not applicable

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.

Hi!

 

Thanks for your reply. I'm not sure if we implemented what you wrote in your answer but you brought us in the right direction. What we did is using a hidden slicer in the reports. On the backend we managed to join the report name to the rls rows. By filtering down the report to the reportname, we get the correct rls structure.

 

 

lbendlin
Super User
Super User

If you use dynamic RLS your can enumerate all the combinations (five) of Org and report that this user is allowed to see via an Org+Report composite key.

 

If you want to go fancy you can define rules like "Report = Illness || Organization = AAA" that cover the same scope.

Helpful resources

Announcements
September Power BI Update Carousel

Power BI Monthly Update - September 2025

Check out the September 2025 Power BI update to learn about new features.

August 2025 community update carousel

Fabric Community Update - August 2025

Find out what's new and trending in the Fabric community.

Top Solution Authors