Forum Discussion
Dynamic RLS using Userprinciplename()
Hi Power BI Experts,
I observed a strange issue in dynamic RLS where i added employee mail id in desktop level using userprinciplename() dax function. It is working fine for few mail id for example "[email protected]" but in our client organization we have different mail id's are there for example "[email protected]" & "[email protected]". Here what is happening is i am able to see the proper data for [email protected] but i am not able to see other mail id's data for different employees("[email protected]" & "[email protected]"). What function i need to use for this mail id employees i have used userprinciplename() function for my development. Please suggest. Thanks.
prakash11440278
You need to first define the username names (Emai IDs) that the users will use to connect to the Power BI service.
"You can use username() within this expression. Be aware that username() has the format of DOMAIN\username within Power BI Desktop. Within the Power BI service and Power BI Report Server, it's in the format of the user's User Principal Name (UPN). Alternatively, you can use userprincipalname(), which always returns the user in the format of their user principal name, [email protected]."
Please refer help as well: https://docs.microsoft.com/en-us/power-bi/admin/service-admin-rls#:~:text=Within%20Power%20BI%20Desktop%2C%20username,User%20Principal%20Name%20(UPN).
2 Replies
- FowmySuper User
prakash11440278
You need to first define the username names (Emai IDs) that the users will use to connect to the Power BI service.
"You can use username() within this expression. Be aware that username() has the format of DOMAIN\username within Power BI Desktop. Within the Power BI service and Power BI Report Server, it's in the format of the user's User Principal Name (UPN). Alternatively, you can use userprincipalname(), which always returns the user in the format of their user principal name, [email protected]."
Please refer help as well: https://docs.microsoft.com/en-us/power-bi/admin/service-admin-rls#:~:text=Within%20Power%20BI%20Desktop%2C%20username,User%20Principal%20Name%20(UPN).- prakash11440278Post Prodigy
Hi Fowmy ,
Thanks for your reply.
You mean to say i need to use the username() function instead of userprinciplename() function?
I have used email=userprinciplename() expression in my model and this one not working because of different mail id's what i showned in above. How to handle this situation?