Don't miss your chance to take the Fabric Data Engineer (DP-600) exam for FREE! Find out how by watching the DP-600 session on-demand now through April 28th.
Learn moreJoin the FabCon + SQLCon recap series. Up next: Power BI, Real-Time Intelligence, IQ and AI, and Data Factory take center stage. All sessions are available on-demand after the live show. Register now
I’m running into an RLS behavior difference between Power BI Desktop and Power BI Service (Fabric) and would appreciate guidance on the recommended/long‑term approach.
I have an RLS rule that needs to support:
This allowed me to extract the BUID (123) and apply company‑level security successfully.
However, in Power BI Service / Fabric, USERNAME() instead returns the UPN:
I want a Fabric‑safe, future‑proof RLS approach that:
Appreciate any best‑practice guidance or design recommendations.
Solved! Go to Solution.
Hello,
To my knowledge, there is no way to get the "simple" username in the service; the USERNAME and USERPRINCIPALNAME functions return the same value. In my opinion, using an extraction rule isn't the best approach. You should instead build a mapping table (UPN - Company) and use it with RLS. You can still use your extraction rule to generate this table if no better source is available.
Hi @Shahami,
Username() in desktop andUsername() in service have different outputs (DOMAIN\Alias and user@company.com respectively)
You can use userprinciplename() in Desktop as well to match the service output and then extract buid from it.
Better solution would be you create a separate master table with username, buid and cmpany like below
| UserKey (UPN) | BUID | Company |
| --------------------------------------------- | ---- | ------- |
| [user1@company.com](mailto:user1@company.com) | 123 | A |
| [user2@company.com](mailto:user2@company.com) | 456 | B |
| [user3@company.com](mailto:user3@company.com) | NULL | C |
Then you can use userprincipalname() in Desktop and then map and apply the RLS.
let me know if you have any further questions.
🌟 I hope this solution helps you unlock your Power BI potential! If you found it helpful, click 'Mark as Solution' to guide others toward the answers they need.
💡 Love the effort? Drop the kudos! Your appreciation fuels community spirit and innovation.
🎖 As a proud SuperUser and Microsoft Partner, we’re here to empower your data journey and the Power BI Community at large.
🔗 Curious to explore more? [Discover here].
Let’s keep building smarter solutions together!
Hi @Shahami ,
Could you please confirm if the issue has been resolved? If not, feel free to reach out if you have any further questions.
Your update would be helpful for other members who may face a similar issue.
Best Regards,
Abdul Rafi
Hi @Shahami ,
Thank you for reaching out to Microsoft Fabric Community and Thanks to @cengizhanarslan , @Gabry and @grazitti_sapna for Sharing valuable insights.
Just wanted to check if you had the opportunity to review the information provided. Please feel free to contact us if you have any further questions.
Best Regards,
Abdul Rafi.
The RLS rule is straightforward since USERPRINCIPALNAME() returns the current user's UPN in Power BI Service and you match it directly against your mapping table:
RLS Filter =
USERPRINCIPALNAME() = UserCompanyMap[UPN]
Place this on the UserCompanyMap table in your role definition. For both COINS and non-COINS users, ensure their UPN exists in UserCompanyMap with the correct company mapping populated at the data layer during refresh.
Hi @Shahami,
Username() in desktop andUsername() in service have different outputs (DOMAIN\Alias and user@company.com respectively)
You can use userprinciplename() in Desktop as well to match the service output and then extract buid from it.
Better solution would be you create a separate master table with username, buid and cmpany like below
| UserKey (UPN) | BUID | Company |
| --------------------------------------------- | ---- | ------- |
| [user1@company.com](mailto:user1@company.com) | 123 | A |
| [user2@company.com](mailto:user2@company.com) | 456 | B |
| [user3@company.com](mailto:user3@company.com) | NULL | C |
Then you can use userprincipalname() in Desktop and then map and apply the RLS.
let me know if you have any further questions.
🌟 I hope this solution helps you unlock your Power BI potential! If you found it helpful, click 'Mark as Solution' to guide others toward the answers they need.
💡 Love the effort? Drop the kudos! Your appreciation fuels community spirit and innovation.
🎖 As a proud SuperUser and Microsoft Partner, we’re here to empower your data journey and the Power BI Community at large.
🔗 Curious to explore more? [Discover here].
Let’s keep building smarter solutions together!
Thank you. My first thought was also to create a table with UPN, company, BUID etc. Thank you.
Hello,
To my knowledge, there is no way to get the "simple" username in the service; the USERNAME and USERPRINCIPALNAME functions return the same value. In my opinion, using an extraction rule isn't the best approach. You should instead build a mapping table (UPN - Company) and use it with RLS. You can still use your extraction rule to generate this table if no better source is available.
Thank you. I thought the same to create mapping table with UPN- Company.
Check out the April 2026 Power BI update to learn about new features.
If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.
A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.
| User | Count |
|---|---|
| 10 | |
| 10 | |
| 9 | |
| 7 | |
| 7 |
| User | Count |
|---|---|
| 42 | |
| 32 | |
| 27 | |
| 19 | |
| 19 |