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

July 7 - July 17 | Round 2 of the Power BI Dataviz World Championships. Don't miss your chance! Learn more

Reply
DariaM
Regular Visitor

Power BI Report Server RLS is error while query is passed to MSSQL

RLS error sometimes occurs when reports are run in Power BI Report Server. In order to track what query is transferred to the database, we installed Profiler on MSSQL.

As a result, we got that query was transferred without user when RLS fell, an example of a query received from PBI in MSSQL:

 

select fn.system_code
     , fn.country
     , fn.region
     , fn.Client_type
     , fn.total_sum
     , fn.od_dt
     , ul.local_user
FROM dbo.get_User_List() ul cross apply dbo.pb_return (ul.email) fn
 

At the same time, multiple queries can be simultaneously passed from PBI to MSSQL when report is executed, but the RLS error set only in the first query. The error is floating, and if the first request was successful, then the report is generated successfully until the session ends.

 

An example of a request from PBI to MSSQL, where RLS worked correctly:

 

SELECT 
TOP (1000001) [t0].[Client_type],
(COUNT_BIG(DISTINCT [t0].[od_dt]) + MAX(CASE WHEN [t0].[od_dt] IS NULL THEN 1 ELSE 0 END))
 AS [a0],SUM([t0].[equity])
 AS [a1]
FROM 
(
(
select fn.system_code     

     , fn.country
     , fn.region
     , fn.Client_type
     , fn.total_sum
     , fn.od_dt
     , ul.local_user
FROM dbo.get_User_List() ul cross apply dbo.pb_return (ul.email) fn
)
)
 AS [t0]
WHERE 
([t0].[local_user] = N'[email protected]')

GROUP BY [t0].[Client_type] 

 

Why is there a problem happened with RLS? And is there any solution?

 

PBI RS Version 1.13.8086.22725(January 2022)

Microsoft SQL Server 2017

2 REPLIES 2
Anonymous
Not applicable

Hi @DariaM ,

 

Can't reproduce your issue, when did this problem start? Have you upgraded to the latest version of PBIRS, and if you are now on the latest version, does this problem still occur in previous versions?
Do other reports have similar experiences?

 

Hope it helps,

 

Best Regards,
Community Support Team _ Caitlyn

 

Good afternoon!

 

The problem started in March and it continues to this day. Updated to the latest version "May 2022". The version "January 2022" was previously installed. The problem occurs randomly on different reports with a request through "DirectQuery".

Helpful resources

Announcements
FabCon and SQLCon Barcelona 2026

FabCon & SQLCon – Barcelona 2026

Join us in Barcelona for FabCon and SQLCon, the Fabric, Power BI, SQL, and AI community event. Save €200 with code FABCMTY200.

60 days of Data Days Carousel

Data Days 2026

Join Fabric Data Days 2026: 60 days of free live/on-demand sessions, challenges, study groups, and certification opportunities.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.