Don't miss your chance to take the Fabric Data Engineer (DP-600) exam for FREE! Find out how by watching the DP-600 session on-demand now through April 28th.
Learn moreJoin the FabCon + SQLCon recap series. Up next: Power BI, Real-Time Intelligence, IQ and AI, and Data Factory take center stage. All sessions are available on-demand after the live show. Register now
I want to filter a table when:
Id in (select EntityId from ShipmentItemPermissionGroup sipg join PermissionGroup pg on pg.Id = sipg.PermissionGroupId join UserPermissionGroup upg on upg.PermissionGroupId = pg.Id join [User] u on u.Id = upg.UserId where u.Username = 'username')
I am adding this for Role permissions. I have tried various ways but unable to get this to work. Can someone suggest a solution for this?
Thanks!
Solved! Go to Solution.
Hi @Anonymous
For this SQL statement, i could obtain a JOIN behavior in DAX using the relationships in data model.
select EntityId from ShipmentItemPermissionGroup sipg join PermissionGroup pg on pg.Id = sipg.PermissionGroupId join UserPermissionGroup upg on upg.PermissionGroupId = pg.Id join [User] u on u.Id = upg.UserId where u.Username = 'username'
edit relationships between the four tables used in the statement based on
UserPermissionGroup[UserId]<->User[Id]
UserPermissionGroup[PermissionGroupId]<->PermissionGroup [Id]
PermissionGroup [Id]<->ShipmentItemPermissionGroup[PermissionGroupId]
Then click on "New Table", enter the formula below
Table =
SELECTCOLUMNS (
FILTER (
SUMMARIZE (
ShipmentItemPermissionGroup,
ShipmentItemPermissionGroup[EntityId],
User[name]
),
[name] = "a"
),
"id", [EntityId]
)
Best Regards
maggie
Hi @Anonymous
From you SQL statement, it seems you are seeking for the ways to join tables and filter the id which meets the conditions, then finally to apply this filter id for RLS.
Please refer to the following articles. If you have difficulties in implementing this in your scenario, please share some data and expected results so that i can analyze for you effeciently.
Best Regards
Maggie
Hi Maggie,
Thanks for your response, I am able to get to the penultimate step but the last join is feeling impossible:
[PermissionGroupId] IN (SELECTCOLUMNS (FILTER(CROSSJOIN(User, UserPermissionGroup), User[Id] = UserPermissionGroup[UserId] && User[Username]="username"), "PermissionGroupId",[PermissionGroupId]))
I want to do a further join on PermissionGroupId to ShipmentItemPermissionGroup.PermissionGroupId but do not know how to do it.
Original query:
Id in (select EntityId from ShipmentItemPermissionGroup sipg join PermissionGroup pg on pg.Id = sipg.PermissionGroupId join UserPermissionGroup upg on upg.PermissionGroupId = pg.Id join [User] u on u.Id = upg.UserId where u.Username = 'username')
Please help. Thanks!
Hi @Anonymous
For this SQL statement, i could obtain a JOIN behavior in DAX using the relationships in data model.
select EntityId from ShipmentItemPermissionGroup sipg join PermissionGroup pg on pg.Id = sipg.PermissionGroupId join UserPermissionGroup upg on upg.PermissionGroupId = pg.Id join [User] u on u.Id = upg.UserId where u.Username = 'username'
edit relationships between the four tables used in the statement based on
UserPermissionGroup[UserId]<->User[Id]
UserPermissionGroup[PermissionGroupId]<->PermissionGroup [Id]
PermissionGroup [Id]<->ShipmentItemPermissionGroup[PermissionGroupId]
Then click on "New Table", enter the formula below
Table =
SELECTCOLUMNS (
FILTER (
SUMMARIZE (
ShipmentItemPermissionGroup,
ShipmentItemPermissionGroup[EntityId],
User[name]
),
[name] = "a"
),
"id", [EntityId]
)
Best Regards
maggie
Check out the April 2026 Power BI update to learn about new features.
If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.
A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.
| User | Count |
|---|---|
| 41 | |
| 37 | |
| 34 | |
| 21 | |
| 16 |
| User | Count |
|---|---|
| 64 | |
| 58 | |
| 31 | |
| 25 | |
| 25 |