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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends September 15. Request your voucher.

Reply
Anonymous
Not applicable

RLS - USERNAME functions are not supported in calculated tables/columns. Any workaround ?

I have this issue and would like to know if anyone has a workaround to it.@@RLS username issue  - USERNAME functions are not supported in calculated tables-columns_01.png@RLS username issue  - USERNAME functions are not supported in calculated tables-columns_02.png

Here is the PBIX link   

@Anonymous.mailbox@gmail.com

5 REPLIES 5
lbendlin
Super User
Super User

No can do.  RLS is purely dynamic, can only work with measures. Hard coding it into calculated columns is a security no-no.

 

Let your data model do the work.

 

Oh, and by the way - USERNAME() doesn't help you once you publish the app. Use USERPRINCIPALNAME() instead.

Anonymous
Not applicable

Thank you, @lbendlin 

Your first sentence:  did you mean to say, no can't do it?

 

Just so you know, our use-case is PowerBI embedded - users are using app-own authentication.  So we are passing the username from our application.  Our data model clearly takes care of our requirement.  The challenge we have is abilty to create a column to identity default user using the simpe transformation described.  Also, USERNAME() and USERPRINCIPALNAME() give us same result.

 

 

I didn't realize you were on embedded. My statement was for service.

Anonymous
Not applicable

@lbendlin do you know of any workaround to this issue? Thank you. 

I already told you my recommendation - Let your data model do the work.

 

Do not attempt to "workaround" an implicit and intentional feature of the app (aka "fighting the API"). In the long run you can't win that fight.

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

Check out the August 2025 Power BI update to learn about new features.

August 2025 community update carousel

Fabric Community Update - August 2025

Find out what's new and trending in the Fabric community.

Top Kudoed Authors