Forum Discussion

Jadegirlify's avatar
Jadegirlify
Helper I
1 year ago
Solved

Need help creating Row Level Security based on the Department Name in the Table

HR Table (HR Report) Department Employee ID Employee email Acct 111 A Smith [email protected] Acct 222 B Daks [email protected] Acct 333 C Mark CM...
  • MFelix's avatar
    1 year ago

    Hi Jadegirlify ,

     

    For this you would need to have a formula in the department column that would get the department for the current login something similar to:

    var selecteduserdepartment = MAXX(FILTER(Users, Users[email] = USERPRINCIPALNAME()), Users[Department])
    
    RETURN
     Users[Department] = selecteduserdepartment

     

    This will allow you to do the filter you need:

    This need to be applied to the user table:

     

     

    My only question is what do you mean when you say that "These employee are not members in the workspace. The report will only be published and shared via powerbi online link"?

     

    What is the Power BI Online Link? Is it the Share to Web link? that this is not a secure link and RLS will not work on top of it?

     

    RLS only works within the service and can be trough a workspace or giving acces to an app.