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

Learn from the best! Meet the four finalists headed to the FINALS of the Power BI Dataviz World Championships! Register now

Reply
Yggdrasill
Responsive Resident
Responsive Resident

Complex Row-level security

I'm struggling with finding the correct solution to a problem that I have.

I have a user table with email addresses.

emailcompany iddepartment iddivision idspecial case 
a@b.comA000
b@c.comB4001
c@c.comB000

 

Now I also have a fact table like so

 

fact idcompany iddepartment iddivision idspecial case
234567A9900
234568A9901
234569B4000
234570B000

 

The steps I need to consider are these

 

  1. First, check what company the user belongs to
  2. Check if the user can view special cases (1 or 0)
  3. If user has 0 in division id then this user will see all divisions and all department, if not use the value to filter fact table
  4. if user has 0 in department id then this user will see all departments under respective divisions

How do I Combine this logic into a DAX code for the roles?

 

I tried implementing similar approach to what Reza Rad does at Radacad: https://radacad.com/dynamic-row-level-security-with-profiles-and-users-in-power-bi

 

I also tried to combine the company id with the special case value, e.g. A-0 (company A and no special cases) or B-1 (company B with special cases) and use that as a Row ID to filter the rows in the fact table. However I don't know how to insert the other logic in 3 & 4.

 

but with no real luck.

1 REPLY 1
v-easonf-msft
Community Support
Community Support

Hi, @Yggdrasill 

You can check whether the solution in this thread works for you.

http://angryanalyticsblog.azurewebsites.net/index.php/2016/12/27/dynamic-rls-via-hierarchy-in-power-... 

 

Best Regards,
Community Support Team _ Eason

 

Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.

March Power BI Update Carousel

Power BI Community Update - March 2026

Check out the March 2026 Power BI update to learn about new features.