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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
Anmolgan
Post Prodigy
Post Prodigy

How to apply RLS A/Q to the Comapny ID

How can we implement the RLS, so that the users linked with the particular guid lets say 1001, can see each others report when filtered with the RLS email address, and the users belonging to the company id 1002 do not see the details of 1001 company id when they loged in??

1 ACCEPTED SOLUTION

Hi @Anmolgan,

 

It works same as username.
You can use username function to find out user, then use user to find related company.
In RLS expression, you can use above company id as filter parameter to apply security filter effect.

 

Logic:

 

1. Username -> user id.
2. User id -> company
3. User id and company id as filter condition.

 

If you still not clear for this, you can share some sample data and I will add these expression to your sample.

 

Regards,

Xiaoxin Sheng

Community Support Team _ Xiaoxin
If this post helps, please consider accept as solution to help other members find it more quickly.

View solution in original post

4 REPLIES 4
v-shex-msft
Community Support
Community Support

Hi @Anmolgan,

 

I think you need to create/add guid to user email table to achieve email - guid mapping.

After these steps, you can refer to below link to know how to create dynamic RLS based on username function.

RLS with UserName()

 

Notice: please remember to turn on the 'apply security filter in both directions' option at edit relationship panel.

5.PNG

 

Regards,

Xiaoxin Sheng

Community Support Team _ Xiaoxin
If this post helps, please consider accept as solution to help other members find it more quickly.

Can you explain this in depth as I want to user [user table]= username() here and also the [comapnyid]= "value provided by the user" if user a b belongs to comapny 1001 and c belongs to 1002, then if user a logs in then he should also be able to see the user b's data, how can I achive this scenerio??
The links which you have only talks about the username() function, and dynamic row level security, I was able to create the below relationship and using the Company[COMPANYID] to sort but how to sort all this together with email? so that all the users belonging to 1001 group id can see each others report??Screenshot (1284).png

 

Hi @Anmolgan,

 

It works same as username.
You can use username function to find out user, then use user to find related company.
In RLS expression, you can use above company id as filter parameter to apply security filter effect.

 

Logic:

 

1. Username -> user id.
2. User id -> company
3. User id and company id as filter condition.

 

If you still not clear for this, you can share some sample data and I will add these expression to your sample.

 

Regards,

Xiaoxin Sheng

Community Support Team _ Xiaoxin
If this post helps, please consider accept as solution to help other members find it more quickly.

How can I share my .pbix file here??

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.