Forum Discussion
Row Level Security in Power BI Report Server
We're using a different method that implements RLS at the database level for Power BI reports. This is in SQL Server 2016.
You can't pass the logged-in user ID to SQL Server. However, if you use 'Windows Authentication' / 'As the user viewing the report' on the Data Source Settings for the report, you can use the SYSTEM_USER function to get the user ID within SQL.
We created a permissions table and a number of security predicates in our DB, using SYSTEM_USER to determine the logged in user. I like this method better than building filters in the report itself because you only have to build the security predicates once; every report you build using those secured tables automatically gets RLS, instead of having to incorporate it in every report.
I think security predicates are only available in SQL Server 2016 and later. In earlier versions you could set up stored procedures or views as the data source for your reports and build the RLS login in those directly.
A potential drawback with this approach is every report user needs a SQL login. We got around that by creating an Active Directory group, giving the group the SQL login, and putting all the report users in the group. That worked well for us because we were already using the AD group for other purposes and we had processes/procedures set up to maintain the group membership.