Forum Discussion
gus_sharpzen
8 years agoNew Member
How to filter on multiple columns
Suppose a table has FIrst Name, Last Name, Nickname. How can I setup a filter/slicer, etc, that allows users to enter a word, and return the rows with that word maching at least one of the 3 columns....
Vvelarde
7 years agoCommunity Champion
Hi, a different way:
A new table - ( Modeling - New Table):
Opciones =
DISTINCT (
UNION (
VALUES ( Tabla1[FirstName] ),
VALUES ( Tabla1[LastName] ),
VALUES ( Tabla1[NickName] )
)
)
A Measure:
Filtro =
VAR Word =
SELECTEDVALUE ( Opciones[Options] )
RETURN
IF (
HASONEFILTER ( Opciones[Options] ),
IF (
CALCULATE ( COUNT ( Tabla1[FirstName] ); Tabla1[FirstName] = Word )
+ CALCULATE ( COUNT ( Tabla1[LastName] ), Tabla1[LastName] = Word )
+ CALCULATE ( COUNT ( Tabla1[NickName] ), Tabla1[NickName] = Word )
> 0,
1,
BLANK ()
),
1
)
Use this measure in the visual level filter --Is not Blank.
Regards
Victor
shanker0510
7 years agoRegular Visitor