Forum Discussion
Conditional Display of Slicers Based on RLS in Power BI / Fabric
- 1 year ago
Hi syl-ade,
You can create a role mapping table like this,
UserEmail Role manager@ company.com Manager [email protected] Employee [email protected] Employee And then to check user role create a measure like this
User Role =
VAR _email = USERPRINCIPALNAME()
RETURN
LOOKUPVALUE(UserRole[Role], UserRole[UserEmail], _email)Now Create a measure to apply filter
Show Employee Slicer = IF([User Role] = "Manager", 1, 0)Create a card visual or transparent shape with custom message
Add this on top of the employee slicer
Use the Show Employee Slicer measure in the visual-level filter of that shape:
Filter condition: Show Employee Slicer = 0
🌟 I hope this solution helps you unlock your Power BI potential! If you found it helpful, click 'Mark as Solution' to guide others toward the answers they need.
💡 Love the effort? Drop the kudos! Your appreciation fuels community spirit and innovation.
🎖 As a proud SuperUser and Microsoft Partner, we’re here to empower your data journey and the Power BI Community at large.
🔗 Curious to explore more? [Discover here].
Let’s keep building smarter solutions together!
Hi syl-ade ,
Thank you for your question about showing or hiding slicers based on user roles or permissions in Power BI. At this time, Power BI does not have a built-in feature to dynamically show or hide slicers based on RLS roles. The most practical and recommended way to handle this is by using Row-Level Security to control what data appears in the slicer. This way, managers will see the full list of employees, while regular employees will only see their own name, which effectively limits their choices without needing to hide the slicer itself. This approach is straightforward to implement, secure, and provides a clear user experience without relying on more complicated solutions like bookmarks or page navigation.
If it is absolutely necessary to hide the slicer visual completely, it can be done using bookmarks and navigation based on roles, but that method tends to be more complex and may make the report less intuitive to use. Overall, tailoring the slicer data with RLS is the best practice in terms of ease of maintenance, security, and reliability. I would be glad to assist you in setting up the RLS roles and the required measures if you would like to move forward with this approach.
Best Regards,
Tejaswi.
Community Support
- Anonymous1 year agoNot applicable
Hi syl-ade .
I wanted to follow up and see if you had a chance to review the information shared. If you have any further questions or need additional assistance, feel free to reach out.
Thank you.
- Anonymous1 year agoNot applicable
Hi syl-ade ,
I wanted to check if you had the opportunity to review the information provided. Please feel free to contact us if you have any further questions.
Thank you.