Forum Discussion

harshagraj's avatar
harshagraj
Post Partisan
6 years ago

Direct Query Page to Select User or Manager based on USERPRINCIPALNAME

Hello all, I am on a direct query mode.

I have two columns User Email and Manager Email. With the AD authentication in DW the data filters accordingly.

I need to create a Landing Page. Landing Page will have two buttons. 1. User 2. Manager 

If a User opens the dashboard Landing Page the User Button should be enabled and for Manager it should be Manager.

Both will work on USERPRINCIPALNAME()

Is it possible? Please guide me

4 Replies

  • Anonymous's avatar
    Anonymous
    Not applicable

    HI harshagraj,

    AFAIK, RLS filter works on the data model level and slicer/filter are works on data view level. (visuals level use virtual tables that generated from data model tables as the source, child-level is impossible to affect its parent)
    So I think you cant use slicer/filter to dynamic affect the filter result of RLS.  In my opinion, I'd like to suggest you add if statement and conditions to your RLS expressions to check multiple data fields to achieve dynamic RLS based on the current user level.

    Regards,

    Xiaoxin Sheng

    • harshagraj's avatar
      harshagraj
      Post Partisan

      Hi Anonymous thankd for the reply. Please can you give me a example? I have two columns Manager Email, User Email.
      If User access the landing page they should see Link A and If Manager then Link B. 
      The Landing page is on Direct Query too.

      • Anonymous's avatar
        Anonymous
        Not applicable

        HI harshagraj,

        You can if statement to check 'manager email' filed to confirm if current username is stored in it.
        If that is a case, it means current user is a manager, then you need to apply filter on 'manager email' field to filter records has the same manager to display his and his users records.
        For other scenarios, it means the current user is a common user, the RLS filter should apply to the 'user email' field to display his records.

        BTW, if your data structure not as same as I mentioned or not use the same processing logic, please share some dummy data and expected filter results to help clarify your requirement and test coding formula.

        Regards,

        Xiaoxin Sheng