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

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes! Register now.

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
September Power BI Update Carousel

Power BI Monthly Update - September 2025

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

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors
Top Kudoed Authors