Forum Discussion
Creating and Parameterizing Roles with more scalability?
Hello, how are you?
I'm wondering if there's a way to create new roles in PowerBI Desktop and parameterize them in a way that I can do it for dozens of roles nad parameters. I'm using them for RLS, so for each role I have a specific table that I parameterize a column, say [id_role], so I create a role called 'Manager X', and then I parameterize a specific table with '[id_role] = id_manager', but the id_manager is being entered manually.
If I had a csv or some other structured format containing two columns: 'role_name' and 'id_manager', could I automatically create all the roles with the 'role_name' and them automatically assign each of them with this parameter (inside the 'rls table', having [id_role] = id_manager)?
I looked it up online in several places, but couldn't find anything on a feature like that.
Thanks for the attention!
allan_vxcase yes, you are making it super complicated for yourself. You can have a table with the Manager Id, Manger Email (used to access Power BI reports), and Store ID they have access to. You will add one role, where you will compare which user is currently logged in and filter these stores they have access to. Check this article for more details
4 Replies
- parry2kSuper User
allan_vxcase yes, you are making it super complicated for yourself. You can have a table with the Manager Id, Manger Email (used to access Power BI reports), and Store ID they have access to. You will add one role, where you will compare which user is currently logged in and filter these stores they have access to. Check this article for more details
- allan_vxcaseNew Member
Thank you very much! I believe this is just what I need!
- parry2kSuper User
allan_vxcase what is your goal? What you are trying to achieve? How do you want RLS to work?
- allan_vxcaseNew Member
Alright. There's my current 'Manage roles' window.
I must create dozens of rows corresponding to each sales manager of my company's physical stores. I need this because every sales manager needs to access only their stores's commercial data. To achieve that, I setup a RLS parameter to filter the tables according to the row. This number is the id of the manager.
Finally, what I'm trying to do is to set up every manager's role with their names for each role, and then have each role pointing to their corresponding id in a specific table (the one that's selected in the picture).
Is there a way for me to set up them automatically, granting each 'role name' and each parameter in a csv or something like that?