The ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM.
Get registeredEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends September 15. Request your voucher.
I have this issue and would like to know if anyone has a workaround to it.@@@
Here is the PBIX link
@Anonymous.mailbox@gmail.com
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.
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.
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.