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
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: [email protected],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: [email protected],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
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.