Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
6 years ago
Solved

Issue with Joins

Hi Experts   I have 2 tables Att( personid,matdistance,catergory) & clus(personid, Grpid, type(buyer/seller)), there should be 1:M from att to clus, due to many duplicates in att, created a table(l...
  • Icey's avatar
    Icey
    6 years ago

    Hello @San1979 ,

    I create a column in T1.

    Column = LOOKUPVALUE(T2[Cat],T2[personUuid],T1[PersonUuid])

    cat.PNG

    And then, create a visual table like this:

    cat2.PNG

    Therefore, the 313 records lost are "Cat - blank ()". But in T2, there is no "Cat - blank() option. The value "Total" is calculated on the basis of T1, not T2. You can create a measure as follows to correct the "Total" value:

    Measure = 
        CALCULATE (
            COUNT ( T1[GroupId] ),
            FILTER ( T1, T1[PersonUuid] IN VALUES ( T2[personUuid] ) )
        )
    

    cat3.PNG

    Best regards

    Icey

    If this post helps,then please consider accepting it as the solution to help other members find it more quickly.

  • Anonymous's avatar
    Anonymous
    6 years ago

    @Icey Thanks for the solution.

    I just want to check, should the blanks be no match of personuuid b/w the 2 tables.

    but I think what are the personuuids present in T1 should be there in T2, then why their target

    cat is based on the condition

    Cat-SWITCH (
    TRUE (),
    t2[FR Dist]>-0 && t2[FR Dist] <-0.41, "Estudiante",
    t2[FR Dist]>0.41 && t2[FR Dist] <-0.45, "Otros")
  • Icey's avatar
    Icey
    6 years ago

    Hi Anonymous ,

     

    But in T2, part of "personUuid" is not there. For example,

     

    T1:

     

    T2: no matched records.

     

    Best Regards,

    Icey