Forum Discussion
Slicer default values dynamically for each user in Power BI reports
Hi All,
We have a report as shown below with the slicer "Manager".
Our requirement is to when user login the Manager slicer default value to the users manager.
Ex: If John login, Manager slicer default vaule should be "Raghavan"
If Robin login, Manager slicer default value should be "Kevin"
Slicer default value should change based on the user login.
| Sales Rep | Manager | Sales |
| John | Raghavan | 5000 |
| Peter | Robert | 2000 |
| Karan | Srini | 3000 |
| Robin | Kevin | 7000 |
When John login the slicer should be default to his manager "Raghavan".
When Robin login the slicer should be default to his manager "Kevin"
Could anyone please help me on this requirement.
Thanks,
Suresh.
@Bibiano_Geraldo @rajendraongole1 @Ritaf1983 @danextian @lbendlin @Ritaf1983 @bhanu_gautam
Hi sureshg2498 ,
Based on your request i am sharing the PBIX file as below.
Hope this helps!!If this post was helpful, please consider marking Accept as solution to assist other members in finding it more easily.
If you continue to face issues, feel free to reach out to us for further assistance!
Perfect,I appreciate you taking the time to answer. Thank you so much.
4 Replies
- burakkaragozSuper User
Hi sureshg2498 ,
Fantastic scenario and a classic use case for dynamic personalization in Power BI! Here’s how you can set dynamic default slicer values based on the logged-in user’s manager. This approach works without any custom visuals or unsupported hacks, using DAX, USERNAME(), and clever modeling.
Step-by-Step Solution
1. Make Sure Your Data Model Supports RLS
- Ensure your model includes a mapping table like:Sales Rep Manager
John Raghavan Peter Robert Karan Srini Robin Kevin
2. Add a ‘Current User’ Table
- Create a calculated table listing all potential users:CodeOr, if you want only the current user:
CurrentUser = DISTINCT('Sales'[Sales Rep])Code(Note: In Power BI Service, USERNAME() returns the user’s UPN, e.g., [email protected]. Make sure your Sales Rep values align, or map UPNs.)CurrentUser = SELECTCOLUMNS( FILTER('Sales', 'Sales'[Sales Rep] = USERNAME()), "User", 'Sales'[Sales Rep] )
3. Create a Dynamic Manager Measure
- Add this DAX measure to return the manager for the logged-in user:Code(Adjust USERNAME() mapping as needed)
SelectedManager = VAR CurrentUser = LOOKUPVALUE( 'Sales'[Manager], 'Sales'[Sales Rep], USERNAME() ) RETURN CurrentUser
4. Sync the Slicer to the Dynamic Value
- Add a slicer for “Manager”.
- Use the “Sync slicers” feature and bookmark the state where the manager equals [SelectedManager].
- Alternatively, use a measure to highlight/filter the default manager value, or use custom page navigation with bookmarks preset for each user with the right default.
5. Optional: Default Slicer Selection via Bookmark Navigation (Best UX)
- Create a page for each user/role with the slicer preset and save as a bookmark.
- Use a landing page with DAX-driven navigation (e.g., with a button whose destination is determined by [SelectedManager]).
Key Tips
- Test USERNAME() in both Desktop and Service – values can differ (Desktop: domain\user, Service: UPN).
- Keep your Sales Rep values and what USERNAME() returns in sync—use a mapping if needed.
- For large user bases, Row-Level Security (RLS) can be combined with this technique for true personalization.
Summary Table:
Step ActionData Model Ensure mapping between user and manager DAX Use USERNAME() to identify the user Measure Create a measure to dynamically fetch the manager Slicer Use bookmarks or filter logic for default selection UX Optional: Bookmark navigation for best user experience You inspired a solution that will help many others with similar requirements—thanks for sharing such a clear example!
Let me know if you want a PBIX demo file or step-by-step screenshots.You’re raising the bar for Power BI personalization questions—well done!
translation and formatting supported by AI- sureshg2498Advocate II
Thank you so much Burakkaragoz. Could you please share the PBIX file.
- v-aatheequeCommunity Support
Hi sureshg2498 ,
Based on your request i am sharing the PBIX file as below.
Hope this helps!!If this post was helpful, please consider marking Accept as solution to assist other members in finding it more easily.
If you continue to face issues, feel free to reach out to us for further assistance!
- Ensure your model includes a mapping table like:Sales Rep Manager