cancel
Showing results for 
Search instead for 
Did you mean: 
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 II
Super User II

@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
PBI User Groups

Welcome to the User Group Public Preview

Check out new user group experience and if you are a leader please create your group!

MBAS on Demand

Microsoft Business Applications Summit sessions

On-demand access to all the great content presented by the product teams and community members! #MSBizAppsSummit #CommunityRocks

Get Ready for Power BI Dev Camp

Power BI Dev Camp - June 24th

Mark your calendars and join us for our next Power BI Dev Camp!

Top Solution Authors
Top Kudoed Authors