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

The Fabric Community site will be in read-only mode on Monday, Feb 24 from 12:01 AM to 8 AM PST for scheduled upgrades.

Reply
tomperro
Helper IV
Helper IV

Pre-Select Slicer Based on User

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

1 ACCEPTED SOLUTION
v-xinruzhu-msft
Community Support
Community Support

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
v-xinruzhu-msft
Community Support
Community Support

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
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

FebPBI_Carousel

Power BI Monthly Update - February 2025

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

Feb2025 Sticker Challenge

Join our Community Sticker Challenge 2025

If you love stickers, then you will definitely want to check out our Community Sticker Challenge!

Feb2025 NL Carousel

Fabric Community Update - February 2025

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