Forum Discussion

ZeinabGad's avatar
ZeinabGad
New Member
7 years ago

Fetching data from two different tables

Hello 

 

I'm currently facing a problem with merging to tables together 

 

 

In one table I have the SKU running on the line and in the other table I have the description of the problem that happened on the line. 

 

I want to identify on which SKU I had a bad material issue 

 

Knowing that I'm having a problem with merging the two tables because in table 2, I have the same date for the same line , for the same shift but for different issues. 

 

Can anyone help with that? 

 

Thanks 

 

Table 1

 

 

DayLine ShiftCodeSKU
2-Feb-2019Line01Aaaa444SKU1
2-Feb-2019Line01Bxxx111SkU2
2-Feb-2019Line01Cxxx222SKU3
2-Feb-2019Line02Azzz111

SKU4

2-Feb-2019Line02Bzzz222SKU5
2-Feb-2019Line02Caaa111SKU6
2-Feb-2019Line03Aaaa222SKU7
2-Feb-2019Line03Baaa222SKU7
2-Feb-2019Line03Ceee333SKU9

 

 

Table 2 

 

 

DayLine ShiftProblem Decription
2- FebLine 3ABad material
2- FebLine 3BBad material 
2- FebLine 3BBad receipe 
2- FebLine 3BBad alignment 
2- FebLine 3CBroken acrylic 
2- FebLine 3Cmachine failure
2- FebLine 3CBreakdown

1 Reply

  • Anonymous's avatar
    Anonymous
    Not applicable

    Please check if this makes sense.

     

    I have added a helper column in both the tables by merging Day, Line & Shift.

    Then established a relationship between 2 tables using the helper columns.

     

    Using the below dax formula, Created a calculated column the table where you have the Problem description to match & pull the associated SKU ID's from table 1.

    SKU = LOOKUPVALUE(SKUTable[SKU],SKUTable[Merged],PrbDescription[Merged])