Forum Discussion
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(lookup_att_clus) with distinct personid.
then i joined lookup_att_clus to both tables and getting 1:M.
now the problem is when I try to bring personid from all 3 tables i am getting an error "can't determine the relationship b/w the fields"
please help to resolve
Hello @San1979 ,
I create a column in T1.
Column = LOOKUPVALUE(T2[Cat],T2[personUuid],T1[PersonUuid])And then, create a visual table like this:
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] ) ) )Best regards
Icey
If this post helps,then please consider accepting it as the solution to help other members find it more quickly.
- Anonymous6 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") Hi Anonymous ,
But in T2, part of "personUuid" is not there. For example,
T1:
T2: no matched records.
Best Regards,
Icey
8 Replies
- amitchandak
Super User
Anonymous
If you have to join A-B(1-M) and A-C.(1-M) Then you will not be able to take from table A, B, C all unsummarised Data. So either from B or C take first or last to Min/max value for the unsummarized attributes
- AnonymousNot applicable
- Icey
Community Support
Hi Anonymous ,
Please share me some sample data for test. Please remove sensitive information.
You can refer to this post to provide sample data: How to provide sample data in the Power BI Forum.
Best Regards,
Icey
- AnonymousNot applicable
- Icey
Community Support
Hello @San1979 ,
I create a column in T1.
Column = LOOKUPVALUE(T2[Cat],T2[personUuid],T1[PersonUuid])And then, create a visual table like this:
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] ) ) )Best regards
Icey
If this post helps,then please consider accepting it as the solution to help other members find it more quickly.