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
Clandestine
New Member

Using Roles to filter data

So I am grabbing data from a table with various fields one of them being 'Username'.

 

I clicked on Modeling --> Manage Roles and added a new Role 'MyData'.

I then added a DAX expression to filter the rows so by Username:  [USERNAME] = Username()

 

I then clicked on Modeling --> View as Roles and selected 'MyData'.  Instantly all the records showing in my report were only those that matched my Username.  Excellent, that is exactly what I wanted.

 

I publish the Report to My Workspace and add a link to it on a web-page.

 

I then click the link on the web-page, the Report opens up which is great but...all the data showing is no longer using the 'MyData' Role.  What's the deal?  I am so close but have spent far too long trying to work it out on my own.  I need help!

1 ACCEPTED SOLUTION

Okay so I have managed to add Users now to my Row Level Security.

 

For all those who are struggling with this bit you need to navigate to the PowerBI service and do it there.  You can't do it in the PowerBI Desktop app.

Click on the Workspace where your report is in and you should have a short menu 'Dashboards, Reports, Workbooks, Datasets.

Click on Datasets and that is where the Elipses is i.e. the three dots '...' .  You click on the three dots and select Security and everything else then makes sense.

 

 

So having added myself in and selected 'Test as Role' I can see that it works brilliantly.  However, when I navigate to the report from Workspace I still see all Records in the table.  Why?

 

(Just to make it clear, I've opening up PowerBI service.  Selecting My Workspace --> Clicking on Reports -->Selecting my Report and...all records rather than just mine.  If I select My Workspace --> Datasets --> ... --> Security --> RLSName ... --> Test as role  The report shows perfectly!)

View solution in original post

4 REPLIES 4
sturlaws
Resident Rockstar
Resident Rockstar

Hi @Clandestine,

 

you have to add users to the role in powerbi.com. Locate your dataset in the left menu, right click on it and choose Security. Add yourself/other users/usergroups that will be using the report, and RLS will work

 

cheers,
Sturla

Thanks Sturla for the reply.  I'm going to have to look at this tomorrow...it;s so frustrating, I'm so close!

 

My left menu only shows three icons - Report, Data and Relationships....I've tried right clicking on all three and looking at the 'Recent Sources' under the Home menu but to no avail.

 

I have just noticed that there is a update so tomorrow I will update my desktop version and hopefully it will all become clear!

 

I do appreciate the reply though.

Okay so I have managed to add Users now to my Row Level Security.

 

For all those who are struggling with this bit you need to navigate to the PowerBI service and do it there.  You can't do it in the PowerBI Desktop app.

Click on the Workspace where your report is in and you should have a short menu 'Dashboards, Reports, Workbooks, Datasets.

Click on Datasets and that is where the Elipses is i.e. the three dots '...' .  You click on the three dots and select Security and everything else then makes sense.

 

 

So having added myself in and selected 'Test as Role' I can see that it works brilliantly.  However, when I navigate to the report from Workspace I still see all Records in the table.  Why?

 

(Just to make it clear, I've opening up PowerBI service.  Selecting My Workspace --> Clicking on Reports -->Selecting my Report and...all records rather than just mine.  If I select My Workspace --> Datasets --> ... --> Security --> RLSName ... --> Test as role  The report shows perfectly!)

Warning: Row Level Security does not work when viewing the report in the Workspace. Anyone that has permission to the Workspace will be able to see all the data. Row Level Security will only restrict data once the report is deployed.

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.