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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
jcmartin01
New Member

Measure with SELECTEDVALUE (attempt to filter by connected user)

Hello,

I was trying to figure out how to filter the ConnectedUser inside PowerBI.

And it is not something obvious, because you can’t easily use the result of USERPRINCIPALNAME() as a filter, except at visual level.

 

I have a table where Item is the primary key :

Item1 > Category1 > User1

Item2 > Category1 > User2

Item3 > Category1 > User2

Item4 > Category2 > User2

Item5 > Category2 > User1

 

I added a measure to my table :

UserDisplayCheck = if(SELECTEDVALUE(TABLE[User])=ConnectedUser,"1","0")

 

My first visual display all the items.

I added a filter at visual level, saying UserDisplayCheck = 1

And it works

 

My second visual display all the Categories.

I also added a filter at visual level, saying UserDisplayCheck = 1

And it doesnt work

 

What I’m guessing is that

  • 1st visual : PBI goes through all the lines of my TABLE. Each time it gets the User and can compare it to the measure and select / unselect according to the value.
  • 2nd visual : PBI does a kind of “select distinct Category” and while going through the results, SELECTEDVALUE if only one among “item1/item5” or “item2/item3/item4”

So even if I have all Users inside each category, I only get Category1 when connected as User1 and Category2 when connected as User2.

 

Is there a workaround ?
I was thinking of creating a DimCategory, add a measure with “RELATED Table” and SUMX(UserDisplayCheck).. but I don’t really know how to do this. And I don’t know if it would ever work. And I would prefer having only one measure for both purpose…

 

Thanks if you can help !

Bye,

JC

 

1 REPLY 1
parry2k
Super User
Super User

@jcmartin01 change your measure to this and in the visual filter make it where value >= 1

 

User Display Check = 
SUMX ( 'Table', IF ( 'Table'[User] = [Connected User], 1 ) )


Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!

Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo

If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤


Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.

Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

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

Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors