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

Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.

Reply
Negi
Helper I
Helper I

Row Level Security

Hi All,

 

I have created a Dashboard in Power BI and importing data from Azure Synapse SQL server using custom SQL. 

In the table apart from rest of the column we have added 3 Roles created which contains multiple users names in comma seperated form as per below mentioned table for each rows.

Role 1Role 2Role 3
A,B,CD,E,FG,H,I

 

and In order to implement RLS we have used 2 measures like below :-

1) Below measure extract the exact user name so that it matches with any of the above mentioned columns.

 

User Access = UPPER(SUBSTITUTE(USERNAME(),"Domain\","",1))

 

2) And then I have used below measure .

 

UserExists = 
VAR CurrentUser = [User Access] // Get the current user's name
RETURN
    IF (
        COUNTROWS (
            FILTER (
                Financial, // Replace with your table name
                [Role 1] = CurrentUser || [Role 2] = CurrentUser || [Role 3] = CurrentUser
            )
        ) > 0,
        TRUE(),
        FALSE()
    )

 

Afte that I go to Managed Roles and created 3 roles (Role 1, Role 2, Role 3 ) there and go to Table name and used this formula :-

 

[UserExists]=True

 

  

After following all the above mentioned steps when I am checking RLS as view as other users than its showing me all the data.

but when I am using view as option as roles than its showing no data which is correct as my name is not in any Role. 

But I am not able to understand why it's showing me all data if I am using other user and those users doesnot exist ?

 

This is first time I am impletment RLS , so looking forward for your valuable inputs. 

2 REPLIES 2
Anonymous
Not applicable

Hi @Negi ,

What type of account are you test? Can you please share some more detail information about this issue? They should help us clarify your scenario and test to troubleshoot.

How to Get Your Question Answered Quickly  

BETWEEN, the role fields seems include multiple values with comma delimiter, I'd like to suggest you use FIND or SEARCH function to check if the current username include.

Regards,

Xiaoxin Sheng

Hi @Anonymous ,

 

I am testing using below option where I am mentioned user name in "other user" tab. 

I am new to DAX as well if you can suggest any other alternative DAX then I will test the same ?

 

 Capture.PNG

Helpful resources

Announcements
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

September Power BI Update Carousel

Power BI Monthly Update - September 2025

Check out the September 2025 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors
Top Kudoed Authors