Join us for an expert-led overview of the tools and concepts you'll need to pass exam PL-300. The first session starts on June 11th. See you there!
Get registeredPower BI is turning 10! Let’s celebrate together with dataviz contests, interactive sessions, and giveaways. Register now.
Hi-
To return UPN, should we always use USERPRINCIPALNAME()?
May anyone help on below question and share me the document where to find the answer? Thanks.
Your network contains an on-premises Active Directory Domain Services (AD DS) domain named
contoso.com that syncs with a Microsoft Entra tenant by using Microsoft Entra Connect.
You have a Fabric tenant that contains a semantic model.
You enable dynamic row-level security (RLS) for the model and deploy the model to the Fabric service.
You query a measure that includes the USERNAME() function, and the query returns a blank result.
You need to ensure that the measure returns the user principal name (UPN) of a user.
Solution: You add user objects to the list of synced objects in Microsoft Entra Connect.
Does this meet the goal?
Solved! Go to Solution.
@New_worker I think it will not fully meet the goal. Syncing user objects via Microsoft Entra Connect is necessary but insufficient on its own. You also need to configure RLS roles properly and consider using USERPRINCIPALNAME() instead of USERNAME() to ensure the UPN is returned correctly.
Hi @New_worker ,
As we haven’t heard back from you, we wanted to kindly follow up to check if the solution provided for the issue worked? or Let us know if you need any further assistance?
If our response addressed, please mark it as Accept as solution and click Yes if you found it helpful.
Regards,
Chaithra.
Hi @New_worker ,
We wanted to kindly follow up to check if the solution provided for the issue worked? or Let us know if you need any further assistance?
If our response addressed, please mark it as Accept as solution and click Yes if you found it helpful.
Regards,
Chaithra.
@New_worker Yes, USERPRINCIPALNAME() should be used to get the UPN in Power BI. The issue with USERNAME() returning a blank result likely arises due to missing user objects in Entra Connect. Adding user objects to the sync list should resolve this. For more info, refer to the Power BI RLS documentation.
If this post helped please do give a kudos and accept this as solution
Thanks In Advance
Hi @Akash_Varuna
Thanks for your reply. As my understanding, syncing user objects via Microsoft Entra Connect is a necessary precondition. But we still need other actions to make username() return the correct value in the model, right..So, I am not sure the answer should be Yes or No for this question....
@New_worker I think it will not fully meet the goal. Syncing user objects via Microsoft Entra Connect is necessary but insufficient on its own. You also need to configure RLS roles properly and consider using USERPRINCIPALNAME() instead of USERNAME() to ensure the UPN is returned correctly.
User | Count |
---|---|
47 | |
30 | |
26 | |
26 | |
26 |
User | Count |
---|---|
58 | |
55 | |
36 | |
33 | |
28 |