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

Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started

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
Fabcon_Europe_Social_Bogo

Europe’s largest Microsoft Fabric Community Conference

Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.

Power BI Carousel June 2024

Power BI Monthly Update - June 2024

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

RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.