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

Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!

Reply
emma313823
Helper IV
Helper IV

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
v-eqin-msft
Community Support
Community Support

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
April AMA free

Microsoft Fabric AMA Livestream

Join us Tuesday, April 09, 9:00 – 10:00 AM PST for a live, expert-led Q&A session on all things Microsoft Fabric!

March Fabric Community Update

Fabric Community Update - March 2024

Find out what's new and trending in the Fabric Community.