Forum Discussion

FAMH's avatar
FAMH
Frequent Visitor
3 years ago
Solved

Filter a table using a column in another table

Hello Community , 

 

  I have Two Table 

Table 1 :  with a column where there is a comment entered by a user : 

 

RowDescription
1 This is  a invoice  IV1234
2IV4356-for client 
3CustomerIV5678Incoiced

 

Table 2  :  

Invoice ID Amount
IV12341000
IV43561500
  

 

I want to filter table1 with only the Invoice ID in table 2  ( Description Contains InvoiceID) and add a column with Invoice ID in table if possible 

 

Does any one have a idea or a suggestion ? 

 

Best Regards 

Thank you for your help 

  • Hi,

    Please check the below picture and the attached pbix file.

    It is for creating a new table.

     

     

     

    New table =
    SUMMARIZE (
        GENERATE (
            'Table 2',
            FILTER (
                'Table 1',
                CONTAINSSTRING ( 'Table 1'[Description], 'Table 2'[Invoice ID] )
            )
        ),
        'Table 1'[Row],
        'Table 1'[Description],
        'Table 2'[Invoice ID]
    )
    

2 Replies

  • Hi,

    Please check the below picture and the attached pbix file.

    It is for creating a new table.

     

     

     

    New table =
    SUMMARIZE (
        GENERATE (
            'Table 2',
            FILTER (
                'Table 1',
                CONTAINSSTRING ( 'Table 1'[Description], 'Table 2'[Invoice ID] )
            )
        ),
        'Table 1'[Row],
        'Table 1'[Description],
        'Table 2'[Invoice ID]
    )
    
  • AbbasG's avatar
    AbbasG
    Memorable Member

    FAMH Here is my possible solution. Hope it helps you to achieve the desired result.

    Step1: From Table 1 I have extracted invoice numbers by adding a custom column.
    Step2: Added a prefix IV to the new extracted column.
    Step3: Merged queries, so that I can see the Amount

    Here is the sample pbix for your reference - https://1drv.ms/u/s!ArEx6MabNbWogQAB2CkSPnYI2F0Q?e=17ervw