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

Next up in the FabCon + SQLCon recap series: The roadmap for Microsoft SQL and Maximizing Developer experiences in Fabric. All sessions are available on-demand after the live show. Register now

Reply
tosho9
Frequent Visitor

Help with multiple value search (array or table) with direct query

Hello, 

 

I struggle to find the correct solution for my problem:

 

I have two direct query tables. Table 1 contains search terms, Table 2 contains the fields to be searched:

Search tems table
xyz-001
xyz-002
xyz-003
abc-001
abc-002
Table 2Identifier
randomtext_xyz-001_randomtextxyz-001
randomtext_xyz-002xyz-002
randomtext_xyz-002xyz-002
xyz-002_randomtextxyz-002
abc-002abc-002
xyz-001xyz-001

 

I need to somehow search Table 2 for the terms in table 1 and then create the Identifier column in table 2 with the search term. 

 

Any help would be greatly appreciated! 

 

Best wishes, T.

1 ACCEPTED SOLUTION

Hi, @tosho9 

 

I don't know this function can't be used in DQ column, but you can try to use measure to display results in table visual.

Like this:

Measure 2 = CALCULATE (
        MAX(  'Table'[Search tems table] ),
        FILTER (
            ALL ( 'Table' ),
            CONTAINSSTRING (max('Table (2)'[Table 2]), [Search tems table])
              
        )
    )

vjaneygmsft_0-1644889253970.png

 

Best Regards,
Community Support Team _ Janey

View solution in original post

4 REPLIES 4
v-janeyg-msft
Community Support
Community Support

Hi, @tosho9 

 

You can create a column.

Like this:

Column = CALCULATE (
        MAX(  'Table'[Search tems table] ),
        FILTER (
            ALL ( 'Table' ),
            CONTAINSSTRING ('Table (2)'[Table 2], [Search tems table])
              
        )
    )

vjaneygmsft_0-1644832762859.png

 

CONTAINSSTRING function (DAX) - DAX | Microsoft Docs

Below is my sample.

 

Did I answer your question? Please mark my reply as solution. Thank you very much.
If not, please feel free to ask me.

Best Regards,
Community Support Team _ Janey

Thank you very much! 

Unfortunately I get the error, that the function calculate cannot be used in direct query.

 

Do you have any Idea how I could do the task with direct query? 

Hi, @tosho9 

 

I don't know this function can't be used in DQ column, but you can try to use measure to display results in table visual.

Like this:

Measure 2 = CALCULATE (
        MAX(  'Table'[Search tems table] ),
        FILTER (
            ALL ( 'Table' ),
            CONTAINSSTRING (max('Table (2)'[Table 2]), [Search tems table])
              
        )
    )

vjaneygmsft_0-1644889253970.png

 

Best Regards,
Community Support Team _ Janey

BMH
Regular Visitor

The column inventory value is calculate by the sum of Cost price an Quantity. But the sum in the buttom is not correct for the coulumn. How can I get it right ?

 

BMH_0-1644409699452.png

 

Helpful resources

Announcements
New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.

Join our Fabric User Panel

Join our Fabric User Panel

Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.

March Power BI Update Carousel

Power BI Community Update - March 2026

Check out the March 2026 Power BI update to learn about new features.