title: How to apply dynamic Row level Security based on Username and location?
body: <p>This is related to Row-level security in Power BI. Here is a dummy table on which I want to implement this RLS.</p>
  
  <p><img src="https://i.stack.imgur.com/LOt0V.png" alt="Please check this table link"></p>
  
  <p>The RLS formula I am using right now is - </p>
  
  <pre><code>[location] = LOOKUPVALUE([location],[login],USERPRINCIPALNAME()) 
  </code></pre>
  
  <p>My end requirement is to make this RLS work on the case where if a user logs in he should see the data if the location he is in and also should see other users who are in the same location. </p>
  
  <p>But lookup is throwing an error:  </p>
  
  <blockquote>
    <p>A table of multiple values was supplied where a single value was expected</p>
  </blockquote>
  
  <p>Also, a single user can have access to multiple location and a single location could have multiple users. </p>
  
  <p>How I can achieve this level of Row-level security using either Lookup or using any other possible way?</p>