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.
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
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
109 | |
99 | |
77 | |
66 | |
54 |
User | Count |
---|---|
144 | |
104 | |
102 | |
87 | |
64 |