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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Learn more

Reply
Anonymous
Not applicable

Matching data from two tables not with lookupvalue as there is more than one result

I have two table that I want to do a lookup, but because lookup value only works when on expected value is in the table. This data set however have multipe. Is there any way to do a lookup to have an out put like this.

 

Table 1    
No.NameNumber  
1AB1234  
23ABCD100  
123DFSD1234  
444EFS422  
     
     
Table 2    
No.NameNumber  
12541353SADSAD1234  
12341423DAADFD100  
14345212DAFSASD1234  
     
     
     
New table 1    
No.NameNumber No. Table 2Name Table 2
1AB123412541353SADSAD
1AB123414345212DAFSASD
23ABCD10012341423DAADFD
123DFSD123412541353SADSAD
123DFSD123414345212DAFSASD
444EFS422  
1 ACCEPTED SOLUTION
tamerj1
Super User
Super User

Hi @Anonymous 
Here is a sample file with the solution https://www.dropbox.com/t/2JpsLFnnm9GrWpHL

1.png

 

Table3 = 
UNION (
    GENERATE ( 
        Table1, 
        SELECTCOLUMNS (
            FILTER ( Table2, Table2[Number] = Table1[Number] ),
            "@Name", Table2[Name],
            "@No .", Table2[No.]
        )
    ),
    ADDCOLUMNS (
        FILTER (
            Table1,
            NOT ( Table1[Number] IN VALUES ( Table2[Number] ) )
        ),
        "@Name", "",
        "@No .", ""
    )
)

 

View solution in original post

5 REPLIES 5
Anonymous
Not applicable

@tamerj1thanks again this works briliant. Is it possible to add another filter function to that it is looking for two matches to be true as part of this? -

 FILTER ( Table2, Table2[Number] = Table1[Number] ),
tamerj1
Super User
Super User

Hi @Anonymous 
Here is a sample file with the solution https://www.dropbox.com/t/2JpsLFnnm9GrWpHL

1.png

 

Table3 = 
UNION (
    GENERATE ( 
        Table1, 
        SELECTCOLUMNS (
            FILTER ( Table2, Table2[Number] = Table1[Number] ),
            "@Name", Table2[Name],
            "@No .", Table2[No.]
        )
    ),
    ADDCOLUMNS (
        FILTER (
            Table1,
            NOT ( Table1[Number] IN VALUES ( Table2[Number] ) )
        ),
        "@Name", "",
        "@No .", ""
    )
)

 

Jihwan_Kim
Super User
Super User

Hi,

I am not sure if I understood your question correctly, but please check the below DAX formula.

It is for creating a new table.

 

New_Table = 
VAR _nonumberlistintable2 =
    EXCEPT ( VALUES ( Table1[Number] ), VALUES ( Table2[Number] ) )
VAR _filtertable1 =
    ADDCOLUMNS (
        FILTER ( Table1, Table1[Number] IN _nonumberlistintable2 ),
        "No1.", BLANK (),
        "Name1", BLANK (),
        "Number1", BLANK ()
    )
RETURN
    UNION (
        GENERATE ( ALL ( Table1 ), FILTER ( Table2, Table2[Number] = Table1[Number] ) ),
        _filtertable1
    )

If this post helps, then please consider accepting it as the solution to help other members find it faster, and give a big thumbs up.


Click here to visit my LinkedIn page

Click here to schedule a short Teams meeting to discuss your question.
tamerj1
Super User
Super User

Hi @Anonymous 

can you build relationships between the two tables? Are trying to create a new calculated table or just a table visual?

Anonymous
Not applicable

A new calculated table

Helpful resources

Announcements
Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

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

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.