Forum Discussion
Dynamic Row Level Security apply on ID
HI Team,
Basically every user having Job ID so based on the JOB id user will see their own data. I need to implement dynamic row level security on job id which is highlighted in yellow color .kindly help which DAX function we can use to apply on Jobid .
Below is the sample data .
Thanks,
Nath
5 Replies
- amitchandakSuper User
Anonymous , For RLS, you need to create role.
One way is you filter based on ID and assign that role to users.
Second is you have table with Job ID and email and then you create a role
[email] = userprincipalname()
How to use Row Level Security (RLS): https://youtu.be/NfdIA0uS6Nk
RLS - Row Level security
https://community.powerbi.com/t5/MBAS-Gallery/Microsoft-Power-BI-Unleash-row-level-security-patterns-in-Power/td-p/712613
https://radacad.com/dynamic-row-level-security-with-organizational-hierarchy-power-bi
https://www.blue-granite.com/blog/using-dynamic-row-level-security-with-organizational-hierarchies- AnonymousNot applicable
Hi Amit,
We have only Job id and first name,last name only and we don’t have email . based on the job id only we need to assign roles .if we look at below screebshot we have only job id.
Can you please confirm any DAX function available to apply roles on the Job id ?
Thanks,
Raghu
- AnonymousNot applicable
Hi All,
We have two tables Fact and User tables . Base on the Job id /Name we need to apply dynamic security roles and we don’t have email id column . when apply relationship between these two tables on LCT_NBR column(common column) its getting many to many relationship .
Can you please guide me how to avoid many to many relationship and any DAX function available to apply roles ID columns?
Thanks,
Nath
- v-chenwuz-msftCommunity Support
Hi Anonymous ,
You can create a new column with each item is unque in this column to avoid many to many relationship. Or create a table only contain LCT_NBR and one to many to user table, one to many to fact table. like the following.Please refer this article.
You seem to be implementing RLS in the wrong way.To implement dynamic rls you must use username() or userprincipalname(). Then you use if() to determine which user is currently logged in and filter out from the role table what the currently logged in user can view. To do this, you need the email column.
If you don't use username(). Then you need to create multiple roles to implement dynamic rls, you can create these roles by department and add all the accounts in that department to that role.
Please refer these blogs.
https://radacad.com/dynamic-row-level-security-with-power-bi-made-simple
https://radacad.com/what-do-you-need-to-implement-dynamic-row-level-security-in-power-bi
Best Regards
Community Support Team _ chenwu zhu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
- AnonymousNot applicable
Thanks.
i have applied relationship between user, unique table and fact table as below. still not able apply roles on the Job ID .
i dont have user name and email but basis on fist_name and lst name i have Concatenate two names.can you please confrim can we apply roles on concatenated column ?
i have applied roles on concatenated column but its not working roles . please guide .
we have only columns like - Job id,Last name, frist name,LCT number,dept number.
Thanks,
Raghu