Forum Discussion
How to filter dimension based on Dynamic RLS applied to another dimension
- 1 year ago
Hi sumanthkakarla , Please let us know if your issue is solved. If it is, consider marking the answer that helped 'Accept as Solution', so others with similar queries can find it easily. If not, please share the details.
Thank you.
I am testing with users who dont have access to powerbi at all where users exist in the account map table.
Hi sumanthkakarla , Thank you for reaching out to the Microsoft Community Forum.
The main issue here seems to be that the slicers (visual filters) are being populated from dimension tables that aren’t affected by Row-Level Security (RLS), even though the fact table is. This is expected behavior in Power BI. By default, RLS doesn't automatically propagate to dimension tables unless you specifically design it to. To make RLS work properly across both your fact and dimension tables, so that slicers only show relevant values, you’ll need to apply RLS logic directly on the dimension tables.
Assuming you have a UserAccess table that maps each USERNAME() to the values they’re allowed to see, create relationships between UserAccess and your three dimension tables: UserAccess --> HealthSystemDim and so on. Apply the [Username] = USERNAME() RLS rule to the UserAccess table. This ensures each user only accesses rows that match their login.
Next, apply RLS filters directly on each dimension table so that only relevant entries appear in slicers. For example, on HealthSystemDim, use:
[HEALTH_SYSTEM] IN
CALCULATETABLE(
VALUES('UserAccess'[HEALTH_SYSTEM]),
'UserAccess'[Username] = USERNAME()
)
If this helped solve the issue, please consider marking it 'Accept as Solution' so others with similar queries may find it more easily. If not, please share the details, always happy to help.
Thank you.
- sumanthkakarla1 year agoHelper II
Thank you v-hashadapu
I can't create a relationship between user access table and the dimension tables based on username as the dimension tables will have only relevant data and no username exists in any of those dimensions.
To overcome this, i have created a dax formula on all those newly created dims and its working as expected, i have to see the performance though.
- v-hashadapu1 year agoCommunity Support
Hi sumanthkakarla , Thanks for the update. Please do let us know, how it is working and if it is performing without any issues, please mark the helpful answer 'Accept as Solution', so others with similar issues may find it easily. Thank you.