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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
Anonymous
Not applicable

Need help in DAX to Apply RLS using DAX

Hi Everyone,

Please help me writing DAX

I've user table like below image attached

 

USER Table.png

 

The user table has joined with the transaction table based on email. Here ClientId is Parent Id 

Below is my requirement. 

  • If any of the users get logged in with DataAccessRole='USER' or NULL, then DAX's responsibility is to filter respective users plus their child.
    • For example, UserID: 142
  • If any of the users get logged in with DataAccessRole='ALL', then DAX responsibility is to filter respective users plus their child data plus other user data with the same ClientId
    • For example, UserID: 110 logged in then the table should be filtered with all users with 82 clientID and 151 users with 110 client Id.

I need DAX to fulfill the above requirements. Any DAX help will be appreciated.

I've been followed below link but don't seem to fulfil my requirement.

https://radacad.com/dynamic-row-level-security-with-organizational-hierarchy-power-bi

Thanks

 

3 REPLIES 3
parry2k
Super User
Super User

@Anonymous if you followed the link what didn't work?



Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!

Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo

If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤


Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.

Anonymous
Not applicable

Hello @parry2k 

I'm getting an error on Path function

"Each value in 'User'[userID] must have the same value in 'User'[MainUserId]. The value '110' has multiple values."

 

Please find the attachment for the Power BI Sample file. If you can please correct the logic in Power BI DAX and share it back to me.

I've added a base User Table that I've tried to convert in the form of hierarchy table data as guided in the above tutorial.

You can create some calculated table from this user table or any idea, will be appreciated. 

 

File Link

 

Thanks

 

Anonymous
Not applicable

Any one here?

Helpful resources

Announcements
FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors