Forum Discussion
RLS for "Reporting Groups"
- 2 years ago
Hey Friendly
here you will find a pbix
that contains a solution based on adapting the semantic model:
I tend to adapt the model instead of leveraging complex DAX statements. The reason for this is that RLS means table iterators are in place, no matter the DAX statement that "defines" the RLS. From my experience, the more simple the DAX, the lesser the performance impact of RLS on the overall query performance.
For this reason, I created a new table, "Security Table" using Power Query. Maybe there are different ways to create this table, I created this table based on the sample data. This table is based on two joins, starting with the Client table. I create a new table by joining the Client table with the ClientReportingGroupMay table. This table provides all the ReportingGroups to which a Client is assigned. The result is shown in the next image:
Then, I joined the "ClientReportingGroupMap" table a second time, but this time, I used the ReportGroupID column, which provides the ClientIDs within the reporting group. This table contains the "peers"; in my example, I only used the ClientID column when expanding the table. I did not rename the column ClientID.1 to "Peers." I think this helps to better understand my approach. The next screenshot shows the final "Security Table" table:
The next image shows the relationship between the "Security Table" and the Client table:The next image shows the configuration of the Row Level Security:
And finally, a very simple report, testing the RLS as user "[email protected]:"
Hopefully, this provides what you are looking for.
Regards,
Tom
Hey Friendly ,
upload the pbix to OneDrive, Google Drive, or Dropbox and share the link.
Make sure that the column email contains email address contains email-address (even if they are not valid), as most likely the DAX for the RLS will leverage the DAX function USERPRINCIPALNAME.
Regards,
Tom
Regards,
Tom
- Friendly2 years agoRegular Visitor
Hi Tom - I DM'd you the files. Cheers!
- TomMartens2 years ago
Super User
I will not work with files shared via DM!
Regards,
Tom
- Friendly2 years agoRegular Visitor