Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
7 years ago
Solved

RLS multiple combination

Hi there,

I would like to implement Dynamic RLS in Power BI but not like Corporate Heirachy manager or report to

The data contain multiple companis and departments and the rolle need to be based on that combination

And my database diagram I have Company table and Department table (I can combine this into one tabe if need it)

How do you approch that scenario?

(I'm thinking TSQL view with string_split() and cross join to generate all possibilities) then do company first and Department second but I need some help.

Like   Principal Name         Company            Department

           [email protected]                  01|16|51             12|14|22|36
            [email protected]                  01|51                 14|22

            [email protected]                   55                      10

Thanks

Oded Dror

  • I just remembered that I had to do something strange with my tables which required me to use the OR. For yours, you should be able to just use the following: 

    1. On the company table - Company[PrincipalName] = UserPrincipalName() 
    2. On the department table - Department[PrincipalName] = UserPrincipalName()

    If it doesn't work for you I will work up a PBIX file that I can share to demonstrate what I am thinking. 

9 Replies

  • v-chuncz-msft's avatar
    v-chuncz-msft
    Community Support

    Anonymous ,

     

    You may select Split Column By Delimiter > Advanced options > Split into Rows in Query Editor.

    • Anonymous's avatar
      Anonymous
      Not applicable

      Thank you for response,

      I was able to create a table based on these combination using TSQL, the issue I'm having is how to set RLS

      with multiple column in a table? my table contain company column and department column 

      Shoud I create a compusite key for uniqness then create a rool based on this key and User Principal Name?

      Iv'e try to do RLS on seperate coluns but it seems to not working.

       

      Thanks,

      Oded Dror