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

July 7 - July 17 | Round 2 of the Power BI Dataviz World Championships. Don't miss your chance! Learn more

Reply
Phantom1980
New Member

Role Level Security

Hi,

I haven't been using power Bi too long and I have a RLS question. I tried using Claude but with no success. My question is as followed:

I have a stats table with the following fields: Period, TkD, Name, Hours and Amount.

When user A logs in, I only want user A to see his information along with user B and C.

When user B logs in, I only want user B to see his own info and no one else.

User C can see everyone's information including his own.

What do I need to do to set up this kind of RLS? Thanks.

Jack

1 ACCEPTED SOLUTION
grazitti_sapna
Super User
Super User

Hi @Phantom1980,

 

You can create a mapping table with type of access to be provided.

Refer Sample .pbix file for reference. (Tested with View role as)

 

if you have the heirarchial data then you can explore PATH and PATHITEMS functions

 

🌟 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!

View solution in original post

5 REPLIES 5
oussamahaimoud
Memorable Member
Memorable Member

Hello @Phantom1980,

Hope you're doing well!

 

Try this solution step by step:

 

  • Create a Security Mapping Table

Create a static table (in Power Query or a manual entry) called RLS_Mapping:

 

Viewer - CanSee

A - A

A - B

A - C

B - B

C - A

C - B

C - C

 

  • Create the RLS Role in Power BI Desktop

Go to Modeling → Manage Roles → Create Role (e.g., StatsRole).

Apply this DAX filter on your Stats table:

 

[Name] IN

    SELECTCOLUMNS(

        FILTER(

            RLS_Mapping,

            RLS_Mapping[Viewer] = USERPRINCIPALNAME()

        ),

        "CanSee", RLS_Mapping[CanSee]

    )

 

If you're using Name values like "A", "B", "C" in the Stats table, this works directly. If you're using full names/emails, align the CanSee column values accordingly.

 

  • Assign Users to the Role in Power BI Service

After publishing, go to Dataset → Security and add users A, B, and C all under the same StatsRole.

 

Remember that you should make sure the Viewer column in RLS_Mapping contains the users' exact UPNs (e.g., [email protected]), not display names.

 

Hope this helps! Don't forget to accept as solution and give kudos 👍 in order to keep helping others.

 

Best regards,

Oussama (Data Consultant - Expert Fabric & Power BI)


  Did my response help you? Clicking Kudos is a small gesture that goes a long way, it encourages contributors and helps the community thrive!


Did I answer your question? Please mark my post as a Solution, it helps others find the answer faster.


Senior Data & BI Consultant · Microsoft Fabric & Power BI Specialist


Connect with me on LinkedIn

v-anbandari
Community Support
Community Support

Hi @Phantom1980,

May I check if this issue has been resolved? If not, Please feel free to contact us if you have any further questions. Your update will be valuable to the community and may assist others with similar concerns.


Thank you.

v-anbandari
Community Support
Community Support

Hi @Phantom1980,
 

Thank you for posting your query in the Microsoft Fabric Community Forum, and thanks to the @cengizhanarslan  and  @grazitti_sapna  for sharing valuable insights.
 

Could you please confirm if your issue has been resolved using the suggested approach? This will help other community members facing similar scenarios.
 

Thank you.

cengizhanarslan
Super User
Super User

You need a mapping table that defines which user can see which names. This gives you full flexibility without creating a separate role for every user.

 

1) Create a new table in Power Query (or as an Excel/CSV source) called RLS_Mapping with two columns: UserEmail and AllowedName.

 

2) Create a relationship from RLS_Mapping[AllowedName] to your stats table's Name column (many-to-one, single direction from RLS_Mapping to stats table).

 

3) In Power BI Desktop, go to Modeling → Manage roles → New role. Name it something like "DataAccess". On the RLS_Mapping table, add this DAX filter:

[UserEmail] = USERPRINCIPALNAME ()

 

4) Publish to the Power BI Service. Go to the semantic model → Security → assign all users to the "DataAccess" role.

 

_________________________________________________________
If this helped, ✓ Mark as Solution | Kudos appreciated
Connect on LinkedIn | Follow on Medium
AI-assisted tools are used solely for wording support. All conclusions are independently reviewed.
grazitti_sapna
Super User
Super User

Hi @Phantom1980,

 

You can create a mapping table with type of access to be provided.

Refer Sample .pbix file for reference. (Tested with View role as)

 

if you have the heirarchial data then you can explore PATH and PATHITEMS functions

 

🌟 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!

Helpful resources

Announcements
FabCon and SQLCon Barcelona 2026

FabCon & SQLCon – Barcelona 2026

Join us in Barcelona for FabCon and SQLCon, the Fabric, Power BI, SQL, and AI community event. Save €200 with code FABCMTY200.

60 days of Data Days Carousel

Data Days 2026

Join Fabric Data Days 2026: 60 days of free live/on-demand sessions, challenges, study groups, and certification opportunities.

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.