Power BI is turning 10! Tune in for a special live episode on July 24 with behind-the-scenes stories, product evolution highlights, and a sneak peek at what’s in store for the future.
Save the dateEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.
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 ?
Many thanks
Solved! Go to Solution.
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.
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.
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.
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.