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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
gopichilla
Resolver III
Resolver III

Row Level Security for Employee Department

Hello, All,

 

I need help on Row Level Security, Here I have a 10 Departments in my Organization and I don't want to show all data to all departments members here I want to show only related department members data.

 

Please help on this.

 

Thanks,

Gopi

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Honestly, I'd need some sample data from you with some screenshots to investigate further.

 

Did you add the consumers to the security role in the service? That option is here:

firefox_2017-10-06_09-55-14.png

 

Also, for testing purposes, you can make a couple of measure to help you see what your security actually looks like.

 

Try this:

Create two new Measures:

User = USERNAME()

Department = LOOKUPVALUE(Departments[Department], Departments[User], USERNAME())

Then add two Card visuals to your report, one each showing the values of these measures. This will show you what the actual username looks like when you log in, and if your Lookupvalue formula actually found a department. If the value doesn't find a department, everything will be blank.

View solution in original post

4 REPLIES 4
Anonymous
Not applicable

You'll need a table that maps your AAD logins to their appropriate department. From there, you can do a simple DAX statement in the row level security feature.

 

Here's the documentation for row-level security:

https://powerbi.microsoft.com/en-us/documentation/powerbi-admin-rls/

 

Your DAX might look something like this:

 

[Department] = LOOKUPVALUE(Departments[Department], Departments[User], USERNAME())

 

 

 

2017-10-06_08-04-54.png

 

Hi, SonnyChilds,

 

Thank you for quick reply let me check.

 

Thank you,

Gopi

Hi, SonnyChilds,

 

I have checked your formula it showing all data in desktop and in the service once apply to security for the new role I mentioned user email id and test role it is showing empty data visuals in my dashboard. 

That person has a department in my organization.

 

How I need to check RLS.

Please help on this and let me know.

 

Thanks,

Gopi

 

 

Anonymous
Not applicable

Honestly, I'd need some sample data from you with some screenshots to investigate further.

 

Did you add the consumers to the security role in the service? That option is here:

firefox_2017-10-06_09-55-14.png

 

Also, for testing purposes, you can make a couple of measure to help you see what your security actually looks like.

 

Try this:

Create two new Measures:

User = USERNAME()

Department = LOOKUPVALUE(Departments[Department], Departments[User], USERNAME())

Then add two Card visuals to your report, one each showing the values of these measures. This will show you what the actual username looks like when you log in, and if your Lookupvalue formula actually found a department. If the value doesn't find a department, everything will be blank.

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

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

April Fabric Community Update

Fabric Community Update - April 2024

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