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

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.

Reply
rav-goli
Frequent Visitor

Dynamic RLS

Hello Everyone,

 

I have a Security table with a list User emails in one column and in the second colum I have entered a DAX expression

 

eg

Email                                      Access Level

john.doe@compnay.com     [Region] = "North"

 

Is there anyway in the 'Table filter DAX expression' part of Manage Roles  to lookup the Users access level and execute that DAX command?

 

Hope this is possible.

 

Thanks

 

 

4 REPLIES 4
jdbuchanan71
Super User
Super User

@rav-goli 

I assume you are trying to filter another table that also has region in it and each user has one or more regions they can see.  What you want in the security table is not the dax expression, you want just the regions that user can see.

2020-06-06_18-54-59.png

Then we use a role to apply the filtering to the data table so the user only sees thier regions.

Modeling > Manage Roles > New Role

You add the filter to your data table.

VAR _UPN = USERPRINCIPALNAME()
RETURN 
    [Region] = 
    LOOKUPVALUE (
        Security[Region],
        Security[Region],Sales[Region],
        Security[Email],_UPN
    )

2020-06-06_18-58-45.png

You can test the results by going to view as other user in modeling.

2020-06-06_19-00-15.png

 

and it will show you what that user would see.

2020-06-06_19-01-43.png

I have attached my sample file for you to look at.

 

 

Hi 

 

 

 

 

 

 

 

 

@rav-goli 

No, you cannot read the string and execute the dax.  If you have users that would need different filters (some region only, some region and color, etc.) you would need different roles as well.

Take a look at the artivles @amitchandak  shared, they will point you in the right direction.

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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