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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
Saniat
Helper V
Helper V

Using username() to check list of username

Hi,

I am using username() function in the measure below username_fetch.

In the filter pane, I can put in condition that if value a or value b is equal to username_fetch, filter the visual.

How about if I want to use a list of usernames to compare? Is there any way to do that ?

Saniat_0-1684159940973.png



Many thanks

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @Saniat ,

 

I suggest you to create a measure to filter your visual.

Measure:

List Contain True/False =
VAR _Username_fetch =
    USERNAME ()
VAR _LIST = { "8120", "8320", "8871" }
VAR _AddCompare =
    ADDCOLUMNS ( _LIST, "True/False", CONTAINSSTRING ( _Username_fetch, [Value] ) )
RETURN
    IF ( TRUE () IN SUMMARIZE ( _AddCompare, [True/False] ), 1, 0 )

Add this measure into visual level filter and set it to show items when value = 1. If the username don't contain the value in list, your visual will show blank.

vrzhoumsft_0-1684306739953.png

 

Best Regards,
Rico Zhou

 

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

 

 

View solution in original post

1 REPLY 1
Anonymous
Not applicable

Hi @Saniat ,

 

I suggest you to create a measure to filter your visual.

Measure:

List Contain True/False =
VAR _Username_fetch =
    USERNAME ()
VAR _LIST = { "8120", "8320", "8871" }
VAR _AddCompare =
    ADDCOLUMNS ( _LIST, "True/False", CONTAINSSTRING ( _Username_fetch, [Value] ) )
RETURN
    IF ( TRUE () IN SUMMARIZE ( _AddCompare, [True/False] ), 1, 0 )

Add this measure into visual level filter and set it to show items when value = 1. If the username don't contain the value in list, your visual will show blank.

vrzhoumsft_0-1684306739953.png

 

Best Regards,
Rico Zhou

 

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

 

 

Helpful resources

Announcements
July 2025 community update carousel

Fabric Community Update - July 2025

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

July PBI25 Carousel

Power BI Monthly Update - July 2025

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

Top Solution Authors