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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
emma313823
Helper V
Helper V

Restricting data

Hi

I have a table which I need to add some restrictions to, but am not sure how to do this in the desktop app.

First, all users have been upgraded to Power BI Pro.

I want to restrict the data by the user name within the data. So I have a column in the table that has the user. Is there a way for me to do this, so when they log into Power BI online, they see only the data assigned to them?

 

The next level on this is within the table there is also a user called NBD, which is a generica bucket of accounts. I want each user to not only see just their data, but I want NBD to be included in this as well. Is there a way to also successfully do this as well?

 

Emma

Emma
4 REPLIES 4
Anonymous
Not applicable

Hi @emma313823 ,

For your case, you need to set roles for thousands of users, so we need dynamic RLS.

USERNAME() returns the domain name and user name of the current connection with the format of domain-name\user-name.

 

It is worth noting that If a user has access to a particular row of data, they can see all the columns of data for that row. So we cannot use RLS to limit the columns or measures accessible by my users.

 

Here are RLS related blog posts.

https://radacad.com/dynamic-row-level-security-with-manager-level-access-in-power-bi

https://radacad.com/dynamic-row-level-security-with-organizational-hierarchy-power-bi

https://radacad.com/dynamic-row-level-security-with-power-bi-made-simple

 

Best regards,

Eyelyn Qin

 

darentengmfs
Post Prodigy
Post Prodigy

Hi @emma313823 

 

You can use Row Level Security (RLS) to do this.

 

Here is an article to get you started.

 

https://docs.microsoft.com/en-us/power-bi/create-reports/desktop-rls

 

 

Hi

Thanks for this link. I guess I'm still confused on what to do.

The article says...You can use username() within this expression. Be aware that username() has the format of DOMAIN\username within Power BI Desktop

 

I don't know what I'm supposed to put in for domain - is this something I obtain from the online admin account?

I selected my table and entered username(bakerd@crowleyassociates.com). I selected the check box and it shows I have some syntax error.

 

Emma

@emma313823 

 

https://powerbi.microsoft.com/en-us/blog/using-username-in-dax-with-row-level-security/

 

This link will explain to you how to use username() in row level security.

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

November Power BI Update Carousel

Power BI Monthly Update - November 2025

Check out the November 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.