The ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM.
Get registeredCompete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.
Hello,
I have one report with the row level security, basically that report shows data based on the user login like manager login, he/she can see all the territories data. If employee logins he/she can see their respective territory list only in the territory filter but now my requiremnt was if manager logins, whatever territory filter conatins all the terrotories list instead of that, by default manager needs to see 1st territory as selected in the territory filter and respective data only. if employee login for example employee belongs to 2 territories so, whatever 1st option in the territory filter that is default option needs to be show.
Thanks in advance!
Hi @Swathi1,
We wanted to kindly check in to see if everything is working as expected after trying the suggested solution. If there’s anything else we can assist with, please don’t hesitate to ask.
If the issue is resolved, we’d appreciate it if you could mark the helpful reply as Accepted Solution it helps others who might face a similar issue.
Warm regards,
Prasanna Kumar
Hi @Swathi1,
We wanted to kindly check in to see if everything is working as expected after trying the suggested solution. If there’s anything else we can assist with, please don’t hesitate to ask.
If the issue is resolved, we’d appreciate it if you could mark the helpful reply as Accepted Solution it helps others who might face a similar issue.
Warm regards,
Prasanna Kumar
Hi @Swathi1,
Just following up to see if the solution provided was helpful in resolving your issue. Please feel free to let us know if you need any further assistance.
If the response addressed your query, kindly mark it as Accepted Solution and click Yes if you found it helpful — this will benefit others in the community as well.
Best regards,
Prasanna Kumar
Hi,
Required furthur assistance.
Hi @Swathi1,
Thanks for reaching out to the Microsoft Fabric Forum Community.
Power BI does not support setting a slicer default selection dynamically based on user login or RLS directly. as a workaround you can Just try this approach.
Create a Territory Rank Table This ranks the visible territories per user.
TerritoryRanked =
ADDCOLUMNS(
VALUES('Territory'[TerritoryName]),
"Rank", RANKX(ALL('Territory'), 'Territory'[TerritoryName], , ASC, DENSE)
)
Create a Measure to Get First Territory
FirstTerritory =
CALCULATE(
SELECTEDVALUE('TerritoryRanked'[TerritoryName]),
FILTER('TerritoryRanked', [Rank] = 1)
)
Create a Card/Visual to Use as Filter, Instead of using a standard slicer for selection, you can. Show this FirstTerritory in a card. Use it in page-level filters or sync’d slicers.
If this helped, please mark the response as the accepted solution and give it a thumbs-up so others can benefit too.
Best regards,
Prasanna Kumar
@Swathi1 Sorry, not sure I understand the question fully.
I think you're asking if the manager and employee can have a slicer pre-filtered based on what they have access to? The difficulty with single select slicers is that if you as a dev select the value, and that value no longer exists after a refresh, the slicer still remembers that value until it is cleared.
You could add a dummy row in the territory table for 'Select a single Territory' and have this as the default selection for all users. That way you can force single select still. Each employee will need to select their territory once, the next time they login it will remember their selection.
Copying DAX from this post? Click here for a hack to quickly replace it with your own table names
Has this post solved your problem? Please Accept as Solution so that others can find it quickly and to let the community know your problem has been solved.
If you found this post helpful, please give Kudos C
I work as a Microsoft trainer and consultant, specialising in Power BI and Power Query.
www.excelwithallison.com
Hi,
If Manager login imagin slicer conatins a,b,c etc list. Now a is a by default selection for the Manager to show.If employee login slicer contains b,c (because of the employee had respective data ) then b is a default selection for the employee to show.
@Swathi1 Thanks for clarifying - that's what I thought you were asking.
Unfortunately I don't know a way to make this work. The workaround I have used in the past is if manager list contains a, b, c, add an option to this list that says 'Select One' (or something similar or whatever you want it to say). Make that the default for everyone.
Otherwise, if manager default is a, when employee logs in they will also see a as default until they select b or c, then a will disappear from their list.
Strange but annoying behaviour but I don't know any other workarounds.
Copying DAX from this post? Click here for a hack to quickly replace it with your own table names
Has this post solved your problem? Please Accept as Solution so that others can find it quickly and to let the community know your problem has been solved.
If you found this post helpful, please give Kudos C
I work as a Microsoft trainer and consultant, specialising in Power BI and Power Query.
www.excelwithallison.com
I agree with the default single select slicer in the screen. For managers - the single select slicer will have all territories while the customer will be displayed only their respective territories and nothing on the slicer list.