Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
3 years ago

RLS on DimUser?

This is a RLS question: I need to show the user’s own data and also Totals; but NOT data from any other specific user.

 

I have my Fact table with several measures, and my Users dimension (DimUser)

 

In the FILTERS, I have a “user name” filter, where all users shall select only see themselves. (there’s a few super-users who should select among all users…)

 

On my .pbix I show 2 visuals:

  • Visual 1: own’s user data,
  • Visual 2: shows totals for all users.

 

I am able to do this because  I use DAX’s  REMOVEFILTERS function.

 

How can I do the RLS I need? The user accessing shall see her/his own data and also totals; but not any other user specific data.

 

I am already doing the RLS in the USERS dimension using [username]= USERNAME()  but of course, its filtering all the way to my fact and my Visual2 gets messed and both visual display on the user's data...

2 Replies

  • aj1973's avatar
    aj1973
    Community Champion

    Hi Anonymous 

    Try using userprincipalname() function instead 

  • JohnAPD's avatar
    JohnAPD
    Frequent Visitor

    You could either create multiple measures or use a calculation group (to change the filter context)

    one that removes the filter (visual1) and one that does not (visual2) it may not be possible to have a mix of data in the same visual and maintain RLS