Forum Discussion
_Martin123
3 years agoFrequent Visitor
Row Level Security based on USERPRINCIPALNAME() and Company hierarchy
Hi Community, I need your help ๐ The scope of this task is to grant users row level access based on their USERPRINCIPALNAME(), and the company hierarchy they belong to. There are approximately ...
- Anonymous3 years ago
Hi _Martin123
I delete the relationship among the three tables, then create dax in RLS
You can refer to it.
VAR _userentity = CALCULATE ( MAX ( RLSUser[Entity] ), RLSUser[User mail] = USERPRINCIPALNAME () ) VAR _entityID = CALCULATE ( MAX ( RLSEntity[Entity ID] ), RLSEntity[Entity] = _userentity ) VAR _filter = SUMMARIZE ( FILTER ( RLSEntity, CONTAINSSTRING ( [Path], _entityID ) ), [Entity] ) RETURN [Entity] IN _filterOutput
Best Regards!
Yolo Zhu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Anonymous
3 years agoNot applicable
Hi _Martin123
I delete the relationship among the three tables, then create dax in RLS
You can refer to it.
VAR _userentity =
CALCULATE ( MAX ( RLSUser[Entity] ), RLSUser[User mail] = USERPRINCIPALNAME () )
VAR _entityID =
CALCULATE ( MAX ( RLSEntity[Entity ID] ), RLSEntity[Entity] = _userentity )
VAR _filter =
SUMMARIZE (
FILTER ( RLSEntity, CONTAINSSTRING ( [Path], _entityID ) ),
[Entity]
)
RETURN
[Entity] IN _filter
Output
Best Regards!
Yolo Zhu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.