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

Level up your Power BI skills this month - build one visual each week and tell better stories with data! Get started

Reply
gracie494
Helper I
Helper I

Row Level Security - Condition based on UserPrincipleName

Trying to create a condition where if user access = 1, they can see all data in the table, if 0 then the access is assigned based on their security row. Below is the fomula but its not working:

 

if( LOOKUPVALUE('Auth Data Tables'[All Access],'Auth Data Tables'[Email],USERPRINCIPALNAME()
)
=1,
TRUE(),
'Auth Data Tables'[Email] = USERPRINCIPALNAME()

)
 
access.png
1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @gracie494 

You can achieve your requirements by assigning different roles to relevant users in the workspace. For those who need to see all the data in the table, you can assign them any of the three roles other than Viewer. For those who need to be restricted by row-level security, you should assign them the Viewer role.

Roles in workspaces in Power BI - Power BI | Microsoft Learn





Best Regards,

Jayleny

 

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

3 REPLIES 3
Anonymous
Not applicable

Hi @gracie494 

You can achieve your requirements by assigning different roles to relevant users in the workspace. For those who need to see all the data in the table, you can assign them any of the three roles other than Viewer. For those who need to be restricted by row-level security, you should assign them the Viewer role.

Roles in workspaces in Power BI - Power BI | Microsoft Learn





Best Regards,

Jayleny

 

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

gracie494
Helper I
Helper I

does not work, 

Kedar_Pande
Super User
Super User

FilteredData = 
IF(
SELECTEDVALUE(UserTable[User Access]) = 1,
1, // If access is 1, show all data
IF(
COUNTROWS(
FILTER(
SecurityTable,
SecurityTable[UserID] = USERPRINCIPALNAME() // Assuming UserID matches with the user's email or ID
)
) > 0,
1, // If user has access based on security row, show data
0 // Otherwise, restrict access
)
)


add this measure to your visual-level filters.
Set the filter condition to show items when FilteredData equals 1.

Helpful resources

Announcements
April Power BI Update Carousel

Power BI Monthly Update - April 2026

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

Fabric SQL PBI Data Days

Data Days 2026 coming soon!

Sign up to receive a private message when registration opens and key events begin.

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.