Forum Discussion

Mvumelwano's avatar
Mvumelwano
Icon for Helper I rankHelper I
6 years ago

lookup without common column

HI Team,

Please assist with DAX, I have 2 tables (Table 1 and Table 2) and i need table 3 (see below example). always "a" = "I" and "d" = "m" and "e" = a measure (n+o)

Table1

codesno
a1
b2
c3
d4
e5
f6

 

Table2

 

code

 

score

k8
l9
m10
n11
o12

measure = 23 (11+12)

 

Table3

codenoscore
a19
b2 
c3 
d410
e523
f6 

 

Kind regards,

Nocha

 

7 Replies

  • Greg_Deckler's avatar
    Greg_Deckler
    Icon for Community Champion rankCommunity Champion
    Soooo, what is the logic to get from Table1 and Table2 to Table3??
    • Mvumelwano's avatar
      Mvumelwano
      Icon for Helper I rankHelper I

      Greg_Deckler 

       

      Logic : always "a" = "I" and "d" = "m" and "e" = a measure (n+o)

       

      Thank you

      Kind regards,

      Mvumelwano

      • Greg_Deckler's avatar
        Greg_Deckler
        Icon for Community Champion rankCommunity Champion

        Perhaps create a measure like:

         

         

        New Measure = 
          SWITCH(MAX('Table1'[codes]),
            "a",LOOKUPVALUE('Table2'[score],'Table2'[code],"l"),
            "d",LOOKUPVALUE('Table2'[score],'Table2'[code],"m"),
            "e",[measure],
            BLANK()
          )

         

  • az38's avatar
    az38
    Icon for Community Champion rankCommunity Champion

    Mvumelwano 

    create a Bridge Table by enter data manualy:

    Code table1 Code table2
    a I
    d m
    e e

     

    create a relationshhips Table1 - bridge and table2 - bridge

    and add what you need to visual

  • Mvumelwano , create a new column in table1 like and then use that in lookup or join

    Switch(True(),
    [codes] = "a" ,"I" ,
    [codes] = "d" , "m",
    [codes] = "e" , "a" ,""
    )

    • Mvumelwano's avatar
      Mvumelwano
      Icon for Helper I rankHelper I

      amitchandak Thank you so much , i see i will be able to do a lookup but what about my last value which is a measure ? "e" = 23

      please see below table 2.

       

      Kind regards

      Mvumelwano

  • v-diye-msft's avatar
    v-diye-msft
    Icon for Community Support rankCommunity Support

    Hi Mvumelwano 

     

    If you've fixed the issue on your own please kindly share your solution. if the above posts help, please kindly mark it as a solution to help others find it more quickly.thanks!