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

Did you hear? There's a new SQL AI Developer certification (DP-800). Start preparing now and be one of the first to get certified. Register now

Reply
Anonymous
Not applicable

Creating a filter based on USERPRINCIPALNAME

Hi everyone,

I have following user table and I have applied Row Level Security based on Organisational Hierarchy. I would like to create a slicer based on logged in user as if logged in person's state is same as user's state then "Domestic" else "International". However, I can't use USERPRINCIPALNAME in calculated columns/tables. so any idea if that's doable? thanks

 

Users.PNG

PATHCONTAINS(Users[Path_Func],LOOKUPVALUE(Users[user ID],Users[email],USERPRINCIPALNAME()))

RowLevelSecurity.PNG

Formula not working beacuse we can't use USERPRINCIPALNAME in calculated columns/tables.

Domestic/Interstate = IF(Users[user State]=LOOKUPVALUE(Users[user State],Users[email],USERPRINCIPALNAME()),"Domestic","Interstate")
error.PNG
4 REPLIES 4
v-luwang-msft
Community Support
Community Support

Hi @Anonymous ,

 

Has your problem been solved, if so, please consider Accept a correct reply as the solution or share your own solution to help others find it.

Best Regards
Lucien

v-luwang-msft
Community Support
Community Support

Hi @Anonymous ,

As we can see from the error message, it isn't supported. What's your purpose? Maybe there are other approaches. For example, we can use a measure like this, then we can filter out these 0s in the Filters.

Measure =
CALCULATE (
    IF (
        MIN ( Users[email])
            =USERPRINCIPALNAME (),
        1,
        0
    )
)

 

 

Did I answer your question? Mark my post as a solution!


Best Regards

Lucien

amitchandak
Super User
Super User

@Anonymous , You can create a  measure as only one value would be there for use login(userprincipalname )

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube
Anonymous
Not applicable

Hi @amitchandak , sorry, not sure how this will solve my problem above?

Helpful resources

Announcements
April Power BI Update Carousel

Power BI Monthly Update - April 2026

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

Fabric SQL PBI Data Days

Data Days 2026 coming soon!

Sign up to receive a private message when registration opens and key events begin.

New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.