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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
tomperro
Helper V
Helper V

Pre-Select Slicer Based on User

Is there a way to pre-select slicers based on the logged in user?

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @tomperro 

You can use pre-slicer visual and rls, you can refer to the following example.

Sample data 

vxinruzhumsft_0-1707113270139.png

Goal: Based on the user to pick the biggest number in advance

1.Create a user table.

vxinruzhumsft_1-1707113375058.png

2.Add the pre-slicer visual to the desktop.

vxinruzhumsft_2-1707113466102.png

3.Add a true/false table

vxinruzhumsft_3-1707113500381.png

4.Create a relationship among the user table and the data table.

vxinruzhumsft_4-1707113538586.png

 

5.Create a measure.

Measure =
VAR a =
    MAXX ( ALLSELECTED ( 'Table (2)' ), [Column2] )
RETURN
    IF ( SELECTEDVALUE ( 'Table (2)'[Column2] ) = a, TRUE (), FALSE () )

Then put the following field to the pre-slicer.

vxinruzhumsft_5-1707113676100.png

 

6.Create a new role in RLS in user table.

[useraccount]=USERPRINCIPALNAME ()

vxinruzhumsft_6-1707113755765.png

 

7.Test the role.

vxinruzhumsft_7-1707113781911.png

vxinruzhumsft_8-1707113825244.png

Best Regards!

Yolo Zhu

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

 

View solution in original post

2 REPLIES 2
Anonymous
Not applicable

Hi @tomperro 

You can use pre-slicer visual and rls, you can refer to the following example.

Sample data 

vxinruzhumsft_0-1707113270139.png

Goal: Based on the user to pick the biggest number in advance

1.Create a user table.

vxinruzhumsft_1-1707113375058.png

2.Add the pre-slicer visual to the desktop.

vxinruzhumsft_2-1707113466102.png

3.Add a true/false table

vxinruzhumsft_3-1707113500381.png

4.Create a relationship among the user table and the data table.

vxinruzhumsft_4-1707113538586.png

 

5.Create a measure.

Measure =
VAR a =
    MAXX ( ALLSELECTED ( 'Table (2)' ), [Column2] )
RETURN
    IF ( SELECTEDVALUE ( 'Table (2)'[Column2] ) = a, TRUE (), FALSE () )

Then put the following field to the pre-slicer.

vxinruzhumsft_5-1707113676100.png

 

6.Create a new role in RLS in user table.

[useraccount]=USERPRINCIPALNAME ()

vxinruzhumsft_6-1707113755765.png

 

7.Test the role.

vxinruzhumsft_7-1707113781911.png

vxinruzhumsft_8-1707113825244.png

Best Regards!

Yolo Zhu

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

 

Ritaf1983
Super User
Super User

Hi @tomperro 
There are a few options for the user to get filtered reports/dashboards according to their needs:
1. He can create a personal bookmark for himself and keep the preferred selections. This is a closest one for your request
More information here :
https://www.youtube.com/watch?v=pHp4L2H7CGg

2. To use Rls, but then the result is a filtered report without the option to change it.

More information is here :
https://www.youtube.com/watch?v=MxU_FYSSnYU

 

3. To use the URL to the report, which can include filters that the user can change if he wants to.

https://learn.microsoft.com/en-us/power-bi/collaborate-share/service-url-filters

 

If this post helps, then please consider Accepting it as the solution to help the other members find it more quickly

 

Regards,
Rita Fainshtein | Microsoft MVP
https://www.linkedin.com/in/rita-fainshtein/
Blog : https://www.madeiradata.com/profile/ritaf/profile

Helpful resources

Announcements
July 2025 community update carousel

Fabric Community Update - July 2025

Find out what's new and trending in the Fabric community.

July PBI25 Carousel

Power BI Monthly Update - July 2025

Check out the July 2025 Power BI update to learn about new features.