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

To celebrate FabCon Vienna, we are offering 50% off select exams. Ends October 3rd. Request your discount now.

Reply
Anonymous
Not applicable

Generate a new table with set of key words

Hi all,

 

I'm trying to generate a new table by filtering for some keywords in my old table.  I tried using filter but it doesn't work.

 

This is the measure I tried:

New_Table = FILTER(Old_Table,OR(OR(OR(CONTAINS(Old_Table,Old_Table[Letter],"A),CONTAINS(Old_Table,Old_Table[Letter],"B")),CONTAINS(Old_Table,Old_Table[Letter],"C")), CONTAINS(Old_Table,Old_Table[Letter],"D")))

 

I have also tried

New_Table = CALCULATE([Calculation], FILTER(Old_Table,OR(OR(OR(CONTAINS(Old_Table,Old_Table[Letter],"A),CONTAINS(Old_Table,Old_Table[Letter],"B")),CONTAINS(Old_Table,Old_Table[Letter],"C")), CONTAINS(Old_Table,Old_Table[Letter],"D"))))

 

Which did not work either.

 

Any help would be highly appreciated!

1 ACCEPTED SOLUTION

Hi @Anonymous 

You can create a column

Column 2 = SEARCH("a",[column],1,0)>0||SEARCH("b",[column],1,0)||SEARCH("c",[column],1,0)||SEARCH("d",[column],1,0)

Capture5.JPG

 

Or you could create a new table(column2 is not created)

Table 2 =
FILTER (
    ADDCOLUMNS (
        'Table',
        "Column 3", SEARCH ( "a", [column], 1, 0 ) > 0
            || SEARCH ( "b", [column], 1, 0 )
            || SEARCH ( "c", [column], 1, 0 )
            || SEARCH ( "d", [column], 1, 0 )
    ),
    [Column 3] = TRUE ()
)

Capture6.JPG

 

Or create a measure

Measure =
IF (
    SEARCH ( "a", MAX ( 'Table'[column] ), 1, 0 ) > 0
        || SEARCH ( "b", MAX ( 'Table'[column] ), 1, 0 )
        || SEARCH ( "c", MAX ( 'Table'[column] ), 1, 0 )
        || SEARCH ( "d", MAX ( 'Table'[column] ), 1, 0 ),
    1
)

Capture7.JPG

Best Regards
Maggie
Community Support Team _ Maggie Li
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

3 REPLIES 3
v-juanli-msft
Community Support
Community Support

Hi @Anonymous 

Enter the formula in the Modeling->New table

Table 2 = FILTER('Table','Table'[letter] IN {"A","B","C","D"})

orignal table

letter
A
B
C
D
Q
E
R
T
Y

Capture12.JPG

 

 

Best Regards
Maggie
Community Support Team _ Maggie Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Anonymous
Not applicable

Hi, thanks for your reply.  I tried your solution, however it's returning me an empty table.  Does it have to do with the fact that my table only contains the keyworks but are not exactly the key words? (i.e. the table may have "apple", "aloe", etc. and I want to find everything with an a)

Hi @Anonymous 

You can create a column

Column 2 = SEARCH("a",[column],1,0)>0||SEARCH("b",[column],1,0)||SEARCH("c",[column],1,0)||SEARCH("d",[column],1,0)

Capture5.JPG

 

Or you could create a new table(column2 is not created)

Table 2 =
FILTER (
    ADDCOLUMNS (
        'Table',
        "Column 3", SEARCH ( "a", [column], 1, 0 ) > 0
            || SEARCH ( "b", [column], 1, 0 )
            || SEARCH ( "c", [column], 1, 0 )
            || SEARCH ( "d", [column], 1, 0 )
    ),
    [Column 3] = TRUE ()
)

Capture6.JPG

 

Or create a measure

Measure =
IF (
    SEARCH ( "a", MAX ( 'Table'[column] ), 1, 0 ) > 0
        || SEARCH ( "b", MAX ( 'Table'[column] ), 1, 0 )
        || SEARCH ( "c", MAX ( 'Table'[column] ), 1, 0 )
        || SEARCH ( "d", MAX ( 'Table'[column] ), 1, 0 ),
    1
)

Capture7.JPG

Best Regards
Maggie
Community Support Team _ Maggie Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

 

Helpful resources

Announcements
September Power BI Update Carousel

Power BI Monthly Update - September 2025

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

August 2025 community update carousel

Fabric Community Update - August 2025

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

Top Solution Authors
Top Kudoed Authors