Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Next up in the FabCon + SQLCon recap series: The roadmap for Microsoft SQL and Maximizing Developer experiences in Fabric. All sessions are available on-demand after the live show. Register now

Reply
OlivierL972
New Member

User name

Hello

I share a Power BI report on Teams. I have defined rulls in my report to limite access according to the person who use the report.

I would like to calculate the name of the person who has opened the report on Teams to limit his view according to the rull I have defined for him.

How can I calculate this?

Thanks for your help.

Olivier

2 ACCEPTED SOLUTIONS
rajendraongole1
Super User
Super User

Hi @OlivierL972  - To calculate and apply row-level security (RLS) based on the name of the person who opens the Power BI report in Microsoft Teams, you can use the USERNAME() or USERPRINCIPALNAME() function in Power BI, which retrieves the logged-in user's credentials.

 

Ref links:

Power BI: Dynamic Security Using USERPRINCIPALNAME ()

Row level Security on a Report Shared in Microsoft... - Microsoft Fabric Community

 





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!





View solution in original post

Anonymous
Not applicable

Hi @OlivierL972 

 

Thank you very much rajendraongole1 for your prompt reply. Allow me to add something.

 

Here are some specific steps to help you set up row-level security (RLS) in Power BI:

 

Here's some dummy data

 

“Name“

vnuocmsft_0-1736407404173.png

 

"Sales"

vnuocmsft_1-1736407487833.png

 

1.
Modeling -> Manage roles

vnuocmsft_2-1736407605571.png

 

2.

 

vnuocmsft_4-1736408197631.png

 

[email] ==  userprincipalname()

 

3.

After setting up the RLS, publish the report to the Power BI service. In Power BI Services, go to the Settings page for the dataset and select Security.

 

vnuocmsft_5-1736408480310.png

 

4.

Share the report to teams.

 

vnuocmsft_6-1736408547776.png

 

Here is the result.

 

vnuocmsft_7-1736408708975.png

 

Row-level security (RLS) with Power BI - Microsoft Fabric | Microsoft Learn

 

Regards,

Nono Chen

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

2 REPLIES 2
Anonymous
Not applicable

Hi @OlivierL972 

 

Thank you very much rajendraongole1 for your prompt reply. Allow me to add something.

 

Here are some specific steps to help you set up row-level security (RLS) in Power BI:

 

Here's some dummy data

 

“Name“

vnuocmsft_0-1736407404173.png

 

"Sales"

vnuocmsft_1-1736407487833.png

 

1.
Modeling -> Manage roles

vnuocmsft_2-1736407605571.png

 

2.

 

vnuocmsft_4-1736408197631.png

 

[email] ==  userprincipalname()

 

3.

After setting up the RLS, publish the report to the Power BI service. In Power BI Services, go to the Settings page for the dataset and select Security.

 

vnuocmsft_5-1736408480310.png

 

4.

Share the report to teams.

 

vnuocmsft_6-1736408547776.png

 

Here is the result.

 

vnuocmsft_7-1736408708975.png

 

Row-level security (RLS) with Power BI - Microsoft Fabric | Microsoft Learn

 

Regards,

Nono Chen

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

rajendraongole1
Super User
Super User

Hi @OlivierL972  - To calculate and apply row-level security (RLS) based on the name of the person who opens the Power BI report in Microsoft Teams, you can use the USERNAME() or USERPRINCIPALNAME() function in Power BI, which retrieves the logged-in user's credentials.

 

Ref links:

Power BI: Dynamic Security Using USERPRINCIPALNAME ()

Row level Security on a Report Shared in Microsoft... - Microsoft Fabric Community

 





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!





Helpful resources

Announcements
New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.

Join our Fabric User Panel

Join our Fabric User Panel

Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.

March Power BI Update Carousel

Power BI Community Update - March 2026

Check out the March 2026 Power BI update to learn about new features.