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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
dogburalHK82
Helper III
Helper III

lookupvalue with number or text

Hi 

I am trying to make Table 3 from Table 1 and Table 2. 

 

Since they are not completely matching, I am not quite sure how I can do a lookupvalue (or other dax).

 

dogburalHK82_0-1685503818985.png

 

Any help would be much appreciated. 

 

2 ACCEPTED SOLUTIONS

@dogburalHK82 
Please try

Table3 =
GENERATE (
    VALUES ( Table1[Item Number] ),
    SELECTCOLUMNS (
        FILTER ( Table2, CONTAINSSTRING ( Table1[Item Number], Table2[Item Number] ) ),
        "Category", Table2[Category]
    )
)

View solution in original post

@dogburalHK82 

Try

Table3 =
MAXX (
    FILTER ( Table2, CONTAINSSTRING ( Table1[Item Number], Table2[Item Number] ) ),
    Table2[Category]
)

View solution in original post

9 REPLIES 9
devanshi
Helper V
Helper V

lookupvalues=LOOKUPVALUE('table3','Table1[item number],'Table2[category])

tamerj1
Super User
Super User

Hi @dogburalHK82 

what is the name of the 2nd column of table2?

@tamerj1 

let me upload with all names in.

dogburalHK82_0-1685506298822.png

 

@dogburalHK82 
Please try

Table3 =
GENERATE (
    VALUES ( Table1[Item Number] ),
    SELECTCOLUMNS (
        FILTER ( Table2, CONTAINSSTRING ( Table1[Item Number], Table2[Item Number] ) ),
        "Category", Table2[Category]
    )
)

@tamerj1 Great thank you.

If I want to create one calculated column next to Item number column in Table 1, what should I use?

@dogburalHK82 

Try

Table3 =
MAXX (
    FILTER ( Table2, CONTAINSSTRING ( Table1[Item Number], Table2[Item Number] ) ),
    Table2[Category]
)

@tamerj1 had tried but got this error

 

dogburalHK82_0-1685515347622.png

 

@dogburalHK82 

You mentioned that you want to create a calycolumn in table1 but seems that you are creating a measure!

@tamerj1 my apologies, i tried it in the different table. It works perfect.

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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

Top Solution Authors