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
Anonymous
Not applicable

Need help with RLS

Hello,

 

I am trying to create a dashboard based on the following scenario

 

  • I have multiple users who will be using the dashboard and need to restrict data displayed based on their user id or email id
  • If a user who is not part of the predefined list logs in , the dashboard should not show any data
  • The visuals will be based on data tab in file attached and the security checks has to be based on user wise facility and users tab
  • I don't have an option to add user id field to data tab
 

Data

https://drive.google.com/file/d/19W6kqK5D9QLoBjoL6DgGQ3j_LdF2hsYr/view?usp=sharing 

 

 

 

I tried creating relationships and setting filters under manage roles but nothing seems to work...either I see all data or don't see any data while toggling through view as option.

 

 

 

Can anyone help me with this. 

 

 

 

1 ACCEPTED SOLUTION

HI @Anonymous ,

 

Can you please refer my last reply on using USERPRINCIPALNAME() instead of USERNAME() in accordance with the article link.

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

 

 

If this helps and resolves the issue, appreciate a Kudos and mark it as a Solution! 

 

 

Thanks,

Pragati

Best Regards,

Pragati Jain


MVP logo


LinkedIn | Twitter | Blog YouTube 

Did I answer your question? Mark my post as a solution! This will help others on the forum!

Appreciate your Kudos!!

Proud to be a Super User!!

View solution in original post

17 REPLIES 17
Anonymous
Not applicable

@Anonymous - Also refer to this RLS playlist on youtube which might help to resolve your problem.

 

https://www.youtube.com/playlist?list=PLRKSzkvyfSLe2gZagN8DYnXiLMV52jDp9

 

BR,

- Pavan M.

Tahreem24
Super User
Super User

@Dilpreeth ,

See the blog below for better RLS clarity. You also have knowledge details in the user table as well.

Don't forget to give thumbs up and accept this as a solution if it helped you!!!

Please take a quick glance at newly created dashboards : Restaurant Management Dashboard , HR Analytics Report , Hotel Management Report, Sales Analysis Report , Fortune 500 Companies Analysis , Revenue Tracking Dashboard
Tahreem24
Super User
Super User

@Anonymous ,

Refer the below blog for better clarity of RLS. Also it has details knowledge on Users table also.

https://docs.microsoft.com/en-us/power-bi/connect-data/desktop-tutorial-row-level-security-onprem-ssas-tabular

 

 

Don't forget to give thumbs up and accept this as a solution if it helped you!!!

Please take a quick glance at newly created dashboards : Restaurant Management Dashboard , HR Analytics Report , Hotel Management Report, Sales Analysis Report , Fortune 500 Companies Analysis , Revenue Tracking Dashboard
Pragati11
Super User
Super User

Hi @Anonymous ,

 

It will nice to have a screenshot around what type of relationships you are creating between your data table and User table.

Also, can you paste the DAX you are using to apply RLS?

 

Thanks,

Pragati

Best Regards,

Pragati Jain


MVP logo


LinkedIn | Twitter | Blog YouTube 

Did I answer your question? Mark my post as a solution! This will help others on the forum!

Appreciate your Kudos!!

Proud to be a Super User!!

Anonymous
Not applicable

Hola Pragati,

Here's what I tried... but it doesn't seem to work

relationship.jpg

Hi @Anonymous ,

 

I have such a table.

nn1.PNG

Then I create a role like this( [Email_Address] column contains the email account.).

nn2.PNG

Then View as the role.

nn3.PNG

 

Best regards,
Lionel Chen

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

 

 

Anonymous
Not applicable

Hello @v-lionel-msft 

 

Thanks for looking into this. I tried settin it up as suggested and seems to be working on my system. However when I publish it to my workspace and share it with my colleague he's seeing this. I have given read access to report as well as dataset but still this comes.

 

 

c.jpg

HI @Anonymous ,

 

Can you please refer my last reply on using USERPRINCIPALNAME() instead of USERNAME() in accordance with the article link.

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

 

 

If this helps and resolves the issue, appreciate a Kudos and mark it as a Solution! 

 

 

Thanks,

Pragati

Best Regards,

Pragati Jain


MVP logo


LinkedIn | Twitter | Blog YouTube 

Did I answer your question? Mark my post as a solution! This will help others on the forum!

Appreciate your Kudos!!

Proud to be a Super User!!

Anonymous
Not applicable

Hi @Pragati11 

 

I had tried that as well...I initally tried with Username() to check against my id field and since that didn't work, i tried USERPRINCIPALNAME() to fetch the email id of the user...both were giving the same issue

Anonymous
Not applicable

@Anonymous  - IS your ID field contains Email Addresses of the users? otherwise, try [Email]=USERPRINCIPALNAME() to have the RLS work properly.

 

BR,

- Pavan M.

HI @Anonymous ,

 

Ok and did you try refrerring to the article link I shared? Your scenario looks very much similar to the example in that link.

 

Thanks,

Pragati

Best Regards,

Pragati Jain


MVP logo


LinkedIn | Twitter | Blog YouTube 

Did I answer your question? Mark my post as a solution! This will help others on the forum!

Appreciate your Kudos!!

Proud to be a Super User!!

Anonymous
Not applicable

Yes @Pragati11 ...that worked....thanks a lot

HI @Anonymous ,

 

Glad that worked for you. 

If it helped can you mark it as a solution for others to refer in future?

 

If this helps and resolves the issue, appreciate a Kudos and mark it as a Solution! 🙂

 

Thanks,

Pragati

Best Regards,

Pragati Jain


MVP logo


LinkedIn | Twitter | Blog YouTube 

Did I answer your question? Mark my post as a solution! This will help others on the forum!

Appreciate your Kudos!!

Proud to be a Super User!!

Anonymous
Not applicable

Hi @Pragati11 

 

Yes I had marked that link which you had shared as the solution

Anonymous
Not applicable

Hi @Pragati11 ,

 

This is what I tried...but doesnt seem to work

 

relationship.jpg

Hi @Anonymous ,

 

Can you please check your DAX expression as it doesn't look right? I think you should use USERPRINCIPALNAME()

Please refer following article to implement RLS in your scenario:

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

 

 

If this helps and resolves the issue, appreciate a Kudos and mark it as a Solution! 🙂

 

Thanks,

Pragati

Best Regards,

Pragati Jain


MVP logo


LinkedIn | Twitter | Blog YouTube 

Did I answer your question? Mark my post as a solution! This will help others on the forum!

Appreciate your Kudos!!

Proud to be a Super User!!

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.