Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.
Good Afternoon:
I am trying to use row level security with the ()username function. I was able to create Measure for username I called it "Login" it returns the results as expected. When I try and link the username measure to the ID it does not return any results.
[LANID] = [Login]
Any insights as to what I am doing wrong? I have a feeling I missing a few steps
Brad
Solved! Go to Solution.
Hi @BradRose,
Within Power BI Desktop, username() will return a user in the format of DOMAIN\User and userprincipalname() will return a user in the format of user@contoso.com.
Within the Power BI service, username() and userprincipalname() will both return the user's User Principal Name (UPN). This looks similar to an email address.
As Matt has mentioned above, username() will return a user in different format within Power BI Desktop and Power BI service. So could you try using the formula below to see if it works?
Login = SUBSTITUTE ( USERPRINCIPALNAME (), "@contoso.com", "" )
In addition, here is a good article about Dynamic RLS in Power BI for your reference.
Regards
What format is the LANID? Is it an email address or domain\username. Be careful as the behaviour on powerbi.com and power bi desktop is different.
Matt:
LANID is a coulmn in our employee table is the just the username. In my measure I have stipped out the domain to match the column in the employee table.
Here is my measure
Login = SUBSTITUTE(USERNAME(),"NESTLE\","")
Brad
Hi @BradRose,
Within Power BI Desktop, username() will return a user in the format of DOMAIN\User and userprincipalname() will return a user in the format of user@contoso.com.
Within the Power BI service, username() and userprincipalname() will both return the user's User Principal Name (UPN). This looks similar to an email address.
As Matt has mentioned above, username() will return a user in different format within Power BI Desktop and Power BI service. So could you try using the formula below to see if it works?
Login = SUBSTITUTE ( USERPRINCIPALNAME (), "@contoso.com", "" )
In addition, here is a good article about Dynamic RLS in Power BI for your reference.
Regards
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
107 | |
100 | |
78 | |
64 | |
58 |
User | Count |
---|---|
148 | |
113 | |
97 | |
84 | |
67 |