Forum Discussion
Role Level Security
- 3 months ago
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!
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)