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.
In Visual Studio I add the filter below to the 'Staff Education Organization' Table.
It only works if I add email address directly in the filter such as "blabla@gmail.com" instead of USERNAME().
but it does not work if I use USERNAME() function.
What can be the problem?
= 'Staff Education Organization'[SchoolID] =
LOOKUPVALUE('Staff Education Organization'[SchoolID],
'Staff Education Organization'[ElectronicMailAddress],
USERNAME()
)
Solved! Go to Solution.
This is what we found:
Username() function is not returning clean email if email is added to AAD as a guest.
It attaches this string at the front:
live.com#
Hey,
maybe you have to consider that USERNAME() might return something different depending on the environment:
a) Power BI Desktop
here USERNAME most likely will return something similar to domain\accountname whereas
b) Power BI Service
here USERNAME will return something like someone@domain.com
Hopefully, this gets you an idea.
Regards,
Tom
Hey Tom,
Thank you for the answer. I deploy the model from VS to Azure and users log in from the add.powerbi.com. As I understand it right, we are using Power BI Service and Usename( ) suppose to return email address which is not working for me. Can you please explain more how to make this work, I am very new to it.
Thank you,
Julia
Hey Julia,
this article may guide you:
I think an essential part will be to add user to the Azure AD
But maybe it will be a good idea to consult your Azure AD administrator, but maybe that's you 🙂
Regards,
Tom
Thank you for the useful article, Tom
I have two emails added to Azure.
The first email is my work account and it’s not an Admin for AAD/Azure, but it IS an Admin (“Owner”) for all the associated resources. So I guess the firsl email will not work for testing.
The second email is added as a guest account.
Whould RLS work on the second email?
This is what we found:
Username() function is not returning clean email if email is added to AAD as a guest.
It attaches this string at the front:
live.com#
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 |
---|---|
111 | |
100 | |
80 | |
64 | |
57 |
User | Count |
---|---|
146 | |
110 | |
93 | |
84 | |
67 |