Forum Discussion
Power BI Embedded Row-Level Security for Multiple values of single attribute
A workaround would be like using
VALUE(USERNAME())="XXXX"&&( [depid] ="depid1"||[depid] ="depid2")
- zq9 years agoFrequent Visitor
How to manage the OR conditions as the number of deprtment ids may vary from user to user. Also, where is "depid1" and "depid2" coming from?
- vinaypugalia9 years agoResolver I
Hello,
There is no need to manage any OR conditions as that is why you have the Roles_Departments mapping table there for.
E.g. Your Roles_Departments mapping tables might have values like -
Role_Id | Department_Id
R1 | D1
R1 | D2
R2 | D3
R3 | D2
R3 | D3
Now, if you pass the particular Role_Id you need via USERNAME(), the related departments will get filtered which will inturn all the related tables showing data only related to those filtered departments.
Hope, this will give you more clarity. If you still have any query, please do write back.
- zq9 years agoFrequent Visitor
Thanks vinaypugalia, i got your point. My previous reply was based on the comment by v-lvzhan-msft. However, I don't have roles in my scenario. Also, such table needs to be modified everytime when the user to depratment mapping changes?