Forum Discussion

sureshg2498's avatar
sureshg2498
Advocate II
1 year ago
Solved

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 RepManagerSales
JohnRaghavan5000
PeterRobert2000
KaranSrini3000
RobinKevin7000

 

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

  • v-aatheeque's avatar
    v-aatheeque
    1 year ago

    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!






  • sureshg2498's avatar
    sureshg2498
    1 year ago

    Perfect,I appreciate you taking the time to answer. Thank you so much.

4 Replies

  • 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
      JohnRaghavan
      PeterRobert
      KaranSrini
      RobinKevin

    2. Add a ‘Current User’ Table

    • Create a calculated table listing all potential users:
      Code
       
      CurrentUser = DISTINCT('Sales'[Sales Rep])
      Or, if you want only the current user:
      Code
       
      CurrentUser = 
          SELECTCOLUMNS(
              FILTER('Sales', 'Sales'[Sales Rep] = USERNAME()),
              "User", 'Sales'[Sales Rep]
          )
      (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.)

    3. Create a Dynamic Manager Measure

    • Add this DAX measure to return the manager for the logged-in user:
      Code
       
      SelectedManager = 
          VAR CurrentUser = 
              LOOKUPVALUE(
                  'Sales'[Manager],
                  'Sales'[Sales Rep], USERNAME()
              )
          RETURN CurrentUser
      (Adjust USERNAME() mapping as needed)

    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 Action
    Data ModelEnsure mapping between user and manager
    DAXUse USERNAME() to identify the user
    MeasureCreate a measure to dynamically fetch the manager
    SlicerUse bookmarks or filter logic for default selection
    UXOptional: 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

    • sureshg2498's avatar
      sureshg2498
      Advocate II

      Thank you so much Burakkaragoz. Could you please share the PBIX file. 

      • v-aatheeque's avatar
        v-aatheeque
        Community 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!