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

Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!

Reply
Anonymous
Not applicable

conditional RLS based on logged user with all values handled

hello,

 

I have prepared RLS access table which contains following attributes:

  • UserUPN
  • BusinessValue

Example data:

user1@xyz.com, A

user1@xyz.com, B

user2@xyz.com, B

user3@xyz.com, C

user1@xyz.com, ALL

user4@xyz.com, ALL

 

now I need to prepare DAX formula which will be applied on one of the dimension. It's need to check if user have access to specific business value and if there is ALL value then he need to have access to all data no matter what. How to do that in optimal way?

 

thank you for your help and regards

 

1 ACCEPTED SOLUTION
V-lianl-msft
Community Support
Community Support

Hi @Anonymous ,

 

You could create a CONTAINS Function.

CONTAINS (
    Table1,
    Table1[xxxx], USERPRINCIPALNAME (),
    Table1[xxx], "All"
)
    || 
xxxxxxxxxxxx

 

Another way is to give these "all" users edit permission in the workspace.

 

Best Regards,
Liang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

2 REPLIES 2
V-lianl-msft
Community Support
Community Support

Hi @Anonymous ,

 

You could create a CONTAINS Function.

CONTAINS (
    Table1,
    Table1[xxxx], USERPRINCIPALNAME (),
    Table1[xxx], "All"
)
    || 
xxxxxxxxxxxx

 

Another way is to give these "all" users edit permission in the workspace.

 

Best Regards,
Liang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

selimovd
Super User
Super User

Hey @Anonymous ,

 

that depends on your data model. In the best case, it should be enough to check for the username. In the mentioned table, you would have to add the following code for the RLS:

 

[UserUPN] = USERPRINCIPALNAME()

 

 

Then it might ne necessary to also implement the check in your fact table. The whole procedure is well described by our friends from RADACAD. Check the following tutorial:

What Do You Need to Implement Dynamic Row-Level Security in Power BI? - RADACAD

 

If you need any help please let me know.
If I answered your question I would be happy if you could mark my post as a solution ✔️ and give it a thumbs up 👍
 
Best regards
Denis
 

Helpful resources

Announcements
April AMA free

Microsoft Fabric AMA Livestream

Join us Tuesday, April 09, 9:00 – 10:00 AM PST for a live, expert-led Q&A session on all things Microsoft Fabric!

March Fabric Community Update

Fabric Community Update - March 2024

Find out what's new and trending in the Fabric Community.