Forum Discussion

ashishg's avatar
ashishg
Icon for Advocate I rankAdvocate I
3 years ago
Solved

RLS security based on State and Company table

Requirement - Apply RLS

 

  1. Fact table should be filer base on email address
  2. one user could be assign to multiple state but same user can be assign withing only one company of any one particular state 

What DAX i will write to filter data
NOTE- IF user have an access of two state like MH and MP , but its having an only one company access "google" then he can be only show data of google company not for other company from another state

amitchandak Greg_Deckler 

  • Anonymous's avatar
    Anonymous
    3 years ago

    HI ashishg,

    Did you mean the company RLS table is the role settings you want to filter on these tables? Is there any index fields include in your ‘State RLS’ table?

    I'd like to suggest you can use the current username and index field to find out the first ‘State’. Then you can use the ‘State’ as condition to lookup the ‘report fact’ table by ‘State’ and ‘product ID’ to find out first company.

    After these steps, you can extract the result 'company' and current 'username' to apply RLS filter on table feilds.

    Regards,

    Xiaoxin Sheng

3 Replies

    • Anonymous's avatar
      Anonymous
      Not applicable

      HI ashishg,

      Did you mean the company RLS table is the role settings you want to filter on these tables? Is there any index fields include in your ‘State RLS’ table?

      I'd like to suggest you can use the current username and index field to find out the first ‘State’. Then you can use the ‘State’ as condition to lookup the ‘report fact’ table by ‘State’ and ‘product ID’ to find out first company.

      After these steps, you can extract the result 'company' and current 'username' to apply RLS filter on table feilds.

      Regards,

      Xiaoxin Sheng