Forum Discussion

skusulja's avatar
skusulja
Frequent Visitor
6 years ago

Filter by user logged in

Hello everyone,

This is yes or no question, probably really simple one.

 

I have report which contains data about employees. How much cases they solved, how many hours they spent resolving certain issues etc. - basically it's their performance. Data is filtered by employees and teams and everyone can see everything. Question is - when an employee opens that report, can those filters be automatically selected so it shows data for that one person who opened the report? So it would probably be a DAX formula which goes to filter/slicer and selects employee based on user who is logged in and who is viewing the report. 

8 Replies

  • skusulja ,

    Yes, When you apply RLS (to restrict users from viewing data) so automatically all the report contents will be filtered out based on the permission of users who logged.

     

    • skusulja's avatar
      skusulja
      Frequent Visitor

      I do not want row level security (RLS) as a feature. I need that all data is visible to others. Just default that it is filter (visualization) to a particular user.

      I have thought to add new DAX column to my Users table with expression:

      CurrentUser = IF(USERPRINCIPALNAME()=Employees[SystemUser.UserName],TRUE(),FALSE())
       
      However, I have error:
      CUSTOMDATA, USERNAME, USERCULTURE and USERPRINCIPALNAME functions are not supported in calculated tables/columns. These functions may only be used in Measures or in the AllowedRowsExpression.
       
      Ok, but is there any other way to set default filter on visualization to a current user?
       
      • Pragati11's avatar
        Pragati11
        Super User

        Hi skusulja ,

         

        • If you are planning to share a single dashboard to multiple users then Row-Level security is the approach that should adopt.
        • If you are planning to distribute multiple dashboards for individual users than you can go with filter on Username. But, this approach is not the right way to go forward with.

         

        Thanks,

        Pragati

  • Hey everyone, 

     

    Is there someone who has a solution for this problem in the meantime? 

     

    If want to do the same thing as asked here so I was wondering if someone has some tips on how to do this. 

     

    Thank you in advance!