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
Anonymous
Not applicable

Userprinciplename () to filter value only visuals

Hi, 

 

I have some visuals that only contain values from the facts table and I would to filter this by userprinciplename, so people only see their values. I tried to make a measure that countrows  fact table but it is not possible to add the measure to the visual filter.

suggestions?

1 ACCEPTED SOLUTION

Hi, @Anonymous 

You can create a new measure 'M_value' to replace the field 'Value'.

M_countrows =
COUNTROWS ( FILTER ( 'Table', 'Table'[Email] = USERPRINCIPALNAME () ) )
M_Value =
CALCULATE (
    SUM ( 'Table'[Value] ),
    FILTER ( 'Table', 'Table'[M_countrows] >0 )
)

 

Best Regards,
Community Support Team _ Eason

View solution in original post

3 REPLIES 3
amitchandak
Super User
Super User

@Anonymous ,

countrows(filter(Table, Table[email] =userprinciplename() ) )

 

Also check RLS

How to use Row Level Security (RLS): https://youtu.be/NfdIA0uS6Nk

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

Coan7_0-1639129793358.png

 

How would countrows measure affect the filtering of the values when it is not possible to put the measure as countrows > 0  in the visual filter 

Hi, @Anonymous 

You can create a new measure 'M_value' to replace the field 'Value'.

M_countrows =
COUNTROWS ( FILTER ( 'Table', 'Table'[Email] = USERPRINCIPALNAME () ) )
M_Value =
CALCULATE (
    SUM ( 'Table'[Value] ),
    FILTER ( 'Table', 'Table'[M_countrows] >0 )
)

 

Best Regards,
Community Support Team _ Eason

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
Top Kudoed Authors