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

Be one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now

Reply
ericjo
Helper I
Helper I

SLICER default settings in reports with RLS.

I would like to set the SLICER default in the report with the RLS, but I would like to thank you for the function.

 

NameDeptScope of AuthorityDefault Slicer
EricpresidentAllHR
TomHRdlHR
JoshR&DR&DR&D
StellaSalesSalesSales

<RLS scenario>
1) If an ERIC with full privileges comes in, HR is selected and sliced.
2) Other people should be chosen by their own.

 

<Issue>
1) If DEPT is made by 'single selection' with HR for the entire permissions, HR is selected when the JOSH is connected to the report.
-> I want to make this part of R & D, not HR.

 

Thank you for telling you how to do it.

3 REPLIES 3
v-kongfanf-msft
Community Support
Community Support

Hi @ericjo ,

 

The solution provided by grazitti_sapna is feasible, can you provide relevant screenshot information as well as test data and describe it?

 

DefaultSlicerValue = 
VAR CurrentUser = USERNAME()
RETURN 
MAXX(
    FILTER(
        'UserTable', 
        'UserTable'[Name] = CurrentUser
    ), 
    'UserTable'[Default Slicer]
)

 

vkongfanfmsft_0-1734946978268.pngvkongfanfmsft_1-1734947017518.pngvkongfanfmsft_2-1734947037986.png

vkongfanfmsft_4-1734947117164.png

 

Best Regards,
Adamk Kong

 

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

grazitti_sapna
Continued Contributor
Continued Contributor

Hi @ericjo,
To handle default slicer settings in Power BI reports with RLS, you can use measures to dynamically set the default slicer values based on user roles. Here's how to achieve your goal:

  1. Your data already includes a Default Slicer column. This column defines the default slicer value for each user based on their department.
  2. Create a Measure to Dynamically Set the Default Value
    Use the following DAX measure to determine the default slicer value based on the logged-in user:
    • DefaultSlicerValue =
      VAR CurrentUser = USERNAME() -- Or USERPRINCIPALNAME() for email-based RLS
      RETURN
      MAXX(
      FILTER(
      'UserTable',
      'UserTable'[Name] = CurrentUser
      ),
      'UserTable'[Default Slicer]
      )
  3. Add RLS Rules
    Implement RLS rules on the UserTable to ensure that users can only see their respective rows.
    For example:

     

    • Filter the UserTable so that each user can only see their own row.

    • Eric (President) should have access to all departments, while others are limited to their department.
      RLS filter example for the UserTable:

      • [Name] = USERNAME() || [Scope of Authority] = "All"
  4. Set Up the Slicer

     

    • Add the Dept column to your slicer.

    • Use a sync slicer if you have multiple pages.

    • Enable Single Selection in the slicer settings.

  5. Use a Bookmark for Default Slicer Behavior
    Create a bookmark to reset the slicer to the default value:

     

    • Set the slicer to the default value (e.g., HR for Eric).

    • Save this as a bookmark.

    • For users without Eric's access, the slicer will automatically be filtered by their department due to the

    • RLS and the DefaultSlicerValue measure.

Expected Behavior

  • If Eric logs in, the slicer defaults to HR (as per the Default Slicer column). Eric can manually change the slicer value to view other departments since he has full access.
  • If Josh logs in, the slicer defaults to R&D, and the report is filtered to show only R&D-related data.
  • Other users like Tom or Stella will see their respective departments as the slicer's default and the report filtered accordingly.

Let me know if you need help setting this up!

If I have resolved your question, please consider marking my post as a solution. Thank you!
A kudos is always appreciated—it helps acknowledge the effort and keeps the community thriving.

Thank you for informing me, and I tested the RLS based on the contents.

 

<Additional>
1. SLICER should be selected as DEAFULT settings.
-> If the report is posted on the basis of ERIC, the slicer is fixed to 'hr' when connected to Stella, and the figures are not available.
-> 'Sales' should be selected when connecting to Stella.

 

<Example IMG>

ericjo_0-1734914330628.png

 

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!

Dec Fabric Community Survey

We want your feedback!

Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.

ArunFabCon

Microsoft Fabric Community Conference 2025

Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.