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

Did you hear? There's a new SQL AI Developer certification (DP-800). Start preparing now and be one of the first to get certified. Register now

Reply
mohittimpus
Helper V
Helper V

RLS dynamic problem

When I use the Hard code Id number then reprot is filtter.

 

But When I try to used "Username()" Function it give error message on all report.

 

Can any one please help.

 Screenshot_1.pngScreenshot_2.pngScreenshot_3.pngScreenshot_4.pngScreenshot_5.pngScreenshot_6.pngScreenshot_7.pngScreenshot_8.png

1 ACCEPTED SOLUTION
v-kelly-msft
Community Support
Community Support

Hi  @mohittimpus ,

 

I see  there're 2 filters in your RLS setting,does the 2 filters make conflict?From the error report,seems the 2 filters contain differenct data type,better check the filters and avoid conflicts.

I will show you sample:

Annotation 2020-02-27 150300.png

Then I click view as role and set other user as: xxx@xxx.com,you will see:

 

Annotation 2020-02-27 150402.png

Here for "other user",you can only fill in with username or userprincipalname,it's used to check who can see the contents.

But if I add another filter,which makes conflicts with the filter I set before, you will see :

Annotation 2020-02-27 150809.png

Annotation 2020-02-27 150924.png

 

As in the column of "ID",it's an int type,but I create an expression to make it equals a text type,which makes conflicts.What's more,even if there's no conflicts in expression,when you make 2 filters ,one makes ID equals 9,and another equals 8,it also will make conflicts, which makes no value appear.

 

Here is the reference about dynamic RLS.

 

Best Regards,
Kelly
 
Did I answer your question? Mark my post as a solution!

View solution in original post

4 REPLIES 4
v-kelly-msft
Community Support
Community Support

Hi  @mohittimpus ,

 

I see  there're 2 filters in your RLS setting,does the 2 filters make conflict?From the error report,seems the 2 filters contain differenct data type,better check the filters and avoid conflicts.

I will show you sample:

Annotation 2020-02-27 150300.png

Then I click view as role and set other user as: xxx@xxx.com,you will see:

 

Annotation 2020-02-27 150402.png

Here for "other user",you can only fill in with username or userprincipalname,it's used to check who can see the contents.

But if I add another filter,which makes conflicts with the filter I set before, you will see :

Annotation 2020-02-27 150809.png

Annotation 2020-02-27 150924.png

 

As in the column of "ID",it's an int type,but I create an expression to make it equals a text type,which makes conflicts.What's more,even if there's no conflicts in expression,when you make 2 filters ,one makes ID equals 9,and another equals 8,it also will make conflicts, which makes no value appear.

 

Here is the reference about dynamic RLS.

 

Best Regards,
Kelly
 
Did I answer your question? Mark my post as a solution!
Anonymous
Not applicable

When you use the Username() it returns your desktop Username
and for UserprincipleName() it returns users emailId

I can see the field you are appling the RLS is number and this functions do not match with it.
TRY Mapping the field with UserEmailId using UserPrincipleName()

Any dynamic funcion where I can used Number like username?

 

 

Anonymous
Not applicable

I am not sure about Function BUT
the workaround is store the UserEmail and UserID In One table and filter the report (Report level filter) by current Users EmailId
it will refer to your Number and report will get filter based on the Number you want.

Helpful resources

Announcements
April Power BI Update Carousel

Power BI Monthly Update - April 2026

Check out the April 2026 Power BI update to learn about new features.

Fabric SQL PBI Data Days

Data Days 2026 coming soon!

Sign up to receive a private message when registration opens and key events begin.

New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

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.