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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

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
PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

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

Top Solution Authors