Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
Anonymous
Not applicable

Auto-Select Slicer Value

I have a table that contains a list of people similar to below:

NameEmail
Sally Jonessally.jones@abc.com
Ed Smithed.smith@abc.com
Jose Perezjose.perez@abc.com
Juanita Clarkjuanita.clark@abc.com
Karen Falkkaren.falk@abc.com
Marcel Thompsonmarcel.thompson@abc.com
Alan Amesalan.ames@abc.com

 

I have a slicer (drop down) visual that I can use to show the list of people (Sally, Ed, Jose, etc.) and what I'd like to do is have the slicer (when report is accessed/loaded) change to who ever is accessing it but still allow the ability to select another person if need be.  So for instance if Karen is accessing the report the drop down will automatically show her name however if she wanted to look at the information for another associate, she could click the drop down arrow and select anyone else she wants (Alan, Marcel, Juanita, etc.)

 

I was able to determine who is logged in/accessing the report by using the following dax ( loggedIn = USERPRINCIPALNAME() ), however I haven't been able to find anything that would allow me to be able to automatically select the userprincipalname for the slicer.  For instance when Jose loads the report, loggedIn shows jose.perez@abc.com and I can't figure out how to make the slicer changed from the first value in the table (sally.jones@abc.com) to my variable (loggedIn).  Does anyone know if this is possible or a work around that could accomplish what I'm looking to do?  Any / all help that can be provided would be much appreciated, thanks.

 

Regards,

Cody

2 REPLIES 2
ribisht17
Super User
Super User

@Anonymous 

 

USERNAME /USERPRINCIPAL will always have the user name of the person logged in.

I don't think this can be handled by DAX.

There is a possibility for an Admin to switch over to other roles (as you can do in Tableau) but not with this Table approach

 

Regards,

Ritesh

 

 

Anonymous
Not applicable

Ritesh,

 

I think I understand what you're saying, let me ask this...  Is it possible to filter a table by correlating the userprincialname to a value in the table?  So for instance I have this measure:

actingsupervisor = IF(
     CALCULATE(
          HASONEVALUE(FTEs[name of supervisor]), ALLSELECTED(FTEs[employee])) = TRUE(),1,2)

 

I then put this measure as a filter on the visual and use it to show items when the value is 1.  This will allow me to display only the employees related to that supervisor in the visual that his this filter.  So is it possible to replace the 'FTEs[name of supervisor]' of the measure above with something like userprincipalname()?

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.