Forum Discussion
Row level security using if-clause
Hello,
I encountered the same scenario. Did you resolve your issue?
How to create a role with DAX. for example if you wanted to have `Restricted access: Company`?
In my case I would like to get the `company` of current user (by matching the id) and filter rows by this company.
Hi Anonymous ,
yes, I have solved my issue, but I solved it differently, not with a DAX statement in the role setup.
I have created calculated tables, that crossjoin the users that have a * (access to everything) with the respective dimension. The DAX statement you'll need is CROSSJOIN().
For example: User A has access to all companies. I therefore receive one line from my security table like the following:
User: Mark
Dimension: Companies
Restriction: *
I am then crossjoining this line with the company dimension, so I am getting a new table that delivers me the user Mark and all companies that exist in that dimension.
This table you can then use to place the RLS restriction on.
Hope this helps, good luck!
- ncbshiva6 years agoAdvocate V
Hi,
Can you please share me the DAX code ?
Regards
Shiva