Forum Discussion
Lock Slicers for Different Users
Hi folks,
I have a single page dashboard which can be filtered by department. I would like, once published, to push this out to different users across an organisation, who work in different departments i.e. when Colleague A (who works in Compliance) opens the report, the report automatically filters on Compliance and the slicer is locked so cannot be changed to another department. Is this possible? Thanks!
5 Replies
- vanessafvgCommunity Champion
are you doing this from a security perspective or just a user experience perspective? Have you considered row level security?
https://www.sqlshack.com/introduction-to-row-level-security-in-power-bi/
- stokidezHelper III
Thanks for the response vanessafvg . More so from a user experience point of view, row level security sounds too extreme for this case. I purely want to set the slicers to certain value depending on the audience - is what I'm asking for possible?
- vanessafvgCommunity Champion
I think its be possible;
First off you would need a list of users and what department they map to. Using the the userprincipal () function to bring back that user name and then map it to which department.
Then you could probably create a switch statement with a dynamic slicer to return the value dependent on department.
userprincipal
https://dax.guide/userprincipalname/
switch()
https://docs.microsoft.com/en-us/dax/switch-function-dax
https://towardsdatascience.com/using-slicers-for-dynamic-chart-adjustment-in-powerbi-47d0ea1b839e
- V-lianl-msftCommunity Support
You can refer to this blog to do data masking:
https://radacad.com/show-the-information-but-not-the-details-power-bi-data-masking
- AnonymousNot applicable
stokidez hi! Have you found a solution? Would be helpful if you share the guideline to this !
best regards,
O