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

Learn from the best! Meet the four finalists headed to the FINALS of the Power BI Dataviz World Championships! Register now

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
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.