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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
Anonymous
Not applicable

Filter to current user by default

I'm trying to enhance a report such that, when the user first opens it, it is filtered to just show their data, but they can then easily flip between just their data, and that for everyone.

 

I've tried using USERPRINCIPALNAME() to create a measure, which works with only limited success, as I can't then use this measure in a slicer so that it applies as a filter accross the whole report.

 

User Scope = if(
    MAXX(
        KEEPFILTERS(VALUES('Table1'[UserName])),
        CALCULATE(MIN('Table1'[UserName]))
    ) = USERPRINCIPALNAME(),
    "Just Me",
    "Everyone"
)

 

Other methods I've seen discussed mention row-level security - this does not sound suitable in my case, as I am not looking to restrict access.

 

Any suggestions?

2 REPLIES 2
Anonymous
Not applicable

You can't have a measure in a slicer. A slicer is taking its data from a table.

Anonymous
Not applicable


@Anonymous wrote:

You can't have a measure in a slicer. A slicer is taking its data from a table.


Yes, that's my understanding, thanks for confirming. USERPRINCIPALNAME() can be used in a measures but not columns, and slicers and page/report level filters can use columns but not measures. It's like there's a wall between what the features/functions will do and the functionality I'm trying to achieve - very frustrating!

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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

Top Solution Authors