Forum Discussion
DAX Code for Dynamic RLS
- 6 years ago
sorry, was a bit quick there, you need to write it like this
VAR _t = CALCULATETABLE ( VALUES ( 'Access_Table'[Access_Required] ), FILTER ( 'Access_Table', 'Access_Table'[User_Email] = USERPRINCIPALNAME () ) ) RETURN IF ( CONTAINS ( _t, 'Access Table'[Access_Required], "National" ) || CONTAINS ( _t, 'Access Table'[Access_Required], "Regional" ), 'dimCompany'[Company] IN CALCULATETABLE ( VALUES ( 'Access_Table'[Company] ), FILTER ( 'Access_Table', 'Access_Table'[User_Email] = USERPRINCIPALNAME () ) ), TRUE () )
Hi, sorry to be bringing this post back to life.
When publishing the report to PBI Service I understand you have said "You should have a ad/security group called something like Everyone or All, add this group to the role you have created."
Can you provide further information on what you mean by this and what needs to be done? Currently I can see the ALL option but not sure what email I meant to add to that list?
Are you asking about how to add users and groups to a role? Or why you should use All/Everyone?
- Anonymous6 years agoNot applicable
So, would I have to add every user that is in the access table to this group? The idea was that this report would be shared externally and then the external companies would be updating a file that would populate the access table. Which I was hoping would mean I wouldnt have to add 100's of users to the report. Is this not the case?
- sturlaws6 years agoResident Rockstar
From what I have read, if a user is not assigned to a role, they will not see any data in the report. But I have not been able to verify this on my own, getting some errors I don't understand. If you like I can send you my e-mail adress, and we can test what it looks like if my adress is not assigned to any role.
If it is nesseccary to add user to a role in order to see the report, it is possible to create dynamic groups in Azure Active directory. It should be possible to build a group for everyone in your domain and for external users. Then add this group to one or more of your roles. Anyone using you report will then be filtered by the RLS.