Forum Discussion
Need help to understand RLS filters
Anonymous , if your backend is SQL server, you can use SQL profile and check that out.
Or Any DB just enable trace for some time and check what all queries are getting executed
https://radacad.com/directquery-connection-in-power-bi-how-does-it-work-limitations-and-advantages
- Anonymous6 years agoNot applicable
Thanks
I can't install SQL Profiler on the organizational system.
Simply answer my questionHow Power BI RLS filters apply to tables?
Is it 1st load into the model and then do RLS filter?
or
Does it send a filtered query to SQL Server?
- sturlaws6 years agoResident Rockstar
Hi Anonymous
I ran a test on my local installation of SQL Server with direct query and RLS, running SQL Profiler and this is the query sent from Power BI Desktop to the SQL Server:
SELECT TOP (501) [t0].[EmailAddress] FROM ( (select [$Table].[BusinessEntityID] as [BusinessEntityID], [$Table].[EmailAddressID] as [EmailAddressID], [$Table].[EmailAddress] as [EmailAddress], [$Table].[rowguid] as [rowguid], [$Table].[ModifiedDate] as [ModifiedDate] from [Person].[EmailAddress] as [$Table]) ) AS [t0] WHERE ([t0].[EmailAddress] = N'[email protected]') GROUP BY [t0].[EmailAddress] ORDER BY [t0].[EmailAddress] ASCThe role was set up to filter on email address and I viewed the report as [email protected]. So with this setup, the filtering is done at the server. I get the same result when testing from Power BI Service.
Cheers,
Sturla
If this post helps, then please consider Accepting it as the solution. Kudos are nice too.