Advance your Data & AI career with 50 days of live learning, dataviz contests, hands-on challenges, study groups & certifications and more!
Get registeredJoin us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM. Register now.
Hello
In a dasboard, I have few dim tables and fact tables and a Dim.employee table.
From the dim employee table we have the company this person is associated to as well as his email (userprincipal)
So suppose that we can add the company field into most of the dim table and fact table, how can we restrict people from company 1 to see the info related to company 1, 2, 3, 4 and peoples from company S to see only the info related to company S. using RLS.
How can we do that
Solved! Go to Solution.
Hi @Anonymous ,
We can use the following steps to meet your requirement.
1. Create a secondary column in dim table.
Column = IF([Company] = "Company1"||[Company] = "Company2"||[Company] = "Company3"||[Company] = "Company4",1,0)
2. Create a DAX formula.
if(calculate(countrows('Dim'), filter('Dim', 'Dim'[Company] = "Company1" && 'Dim'[Email] = Username())) > 0, [Column] = 0, [Email] = Username())
The result like this,
If it doesn’t meet your requirement, could you please show the exact expected result based on the table that we have shared?
BTW, pbix as attached.
Best regards,
Community Support Team _ zhenbw
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi @Anonymous ,
We can use the following steps to meet your requirement.
1. Create a secondary column in dim table.
Column = IF([Company] = "Company1"||[Company] = "Company2"||[Company] = "Company3"||[Company] = "Company4",1,0)
2. Create a DAX formula.
if(calculate(countrows('Dim'), filter('Dim', 'Dim'[Company] = "Company1" && 'Dim'[Email] = Username())) > 0, [Column] = 0, [Email] = Username())
The result like this,
If it doesn’t meet your requirement, could you please show the exact expected result based on the table that we have shared?
BTW, pbix as attached.
Best regards,
Community Support Team _ zhenbw
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi @Anonymous ,
take a look at this.
https://radacad.com/dynamic-row-level-security-with-profiles-and-users-in-power-bi
Marcus Wegener works as Full Stack Power BI Engineer at BI or DIE.
His mission is clear: "Get the most out of data, with Power BI."
twitter - LinkedIn - YouTube - website - podcast - Power BI Tutorials