Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
RashmitaR
Helper IV
Helper IV

Two Roles to one user and switch between roles

Hi,

 

There is a User who has two roles. The access to these roles are maintained in a table which has all the dimensions as columns. For example if a User is a Geography Head, Geo_Id column will have that particular geography's code against the user. 

In our scenario the user is both Geography Head and also Vertical Head, and Geography code and Vertical code are populated against the user in the table. When we do Row level security, the data is fetched as a combination of Geography and Vertical, but the user should be able to see the whole data related to the Geo or the whole data related to the vertical(based on the user's preference of looking at the report).

 

If the user wants to view the data as only the Geography head or the vertical head how can we achieve this?

3 REPLIES 3
Anonymous
Not applicable

Hi @RashmitaR,

 

You can use query editor to achieve your requirement.

 

Sample:

 

Capture.PNG

 

Capture2.PNG

 

Capture3.PNG

 

 Then create the role level security:

Capture4.PNGCapture5.PNG

 

Result:

Capture6.PNGCapture7.PNG

 

 

Regards,

Xiaoxin Sheng

@Anonymous I will ellaborate what my issue is 

 

I have few table two of them are :

User_access_table 

1.PNG

 

user_table 

2.PNG

 

 

These were the roles provided to me 3.PNG

 

 

4.PNG

 So basicaly What I want is any user who logs into their power bi, their user id is obtained from the username() function and is matched with the user_table which is mapped to the user_access_table.

 

now from the user access table if there is any value in the geo_id column that means that, that paticular person is the head of that geography and if he has some value in the vertical_id column that means he is the head of that vertical.

 

Now i have created 3 roles geo_head,vertical head and the one who can see an intersection of both

 

and then after going into power bi services i can allocate each user their respective roles .

But my major concern is that this allocation to various roles is affodable only if there are lesser number of users .If there are say 500 users then manually allocating them roles in services will take huge manpower which i need  to reduce  any way how I can achieve this.

 

 

Anonymous
Not applicable

Hi @RashmitaR,

 

Sorry for slow response, you can take a look at below link about dynamic RLS:

Tutorial: Dynamic row level security with Analysis services tabular model

 

Regards,

Xiaoxin Sheng

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.