Forum Discussion

PSan1979's avatar
PSan1979
Icon for Helper II rankHelper II
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(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

 

 

 

 

 

 

  • PSan1979's avatar
    PSan1979
    6 years ago

    @v-lid-msft Thank you for the effort

    catering column depending on the condition.

    If matdistnce > 6 then Far else Near

    grpid -distinctcount(grpid)

    I need something like this.

    Capture.JPG

    but I'm currently getting 18 for both and close. it's a bad thing with the data model. I've used the same joints as I u used

5 Replies

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

    Hi PSan1979 ,

     

    What are the columns you applied into the fields of visual? Have you tried to use the personid in the distinct table as the field? Or you can try to change the single relationship to both.

     

     


    By the way, PBIX file as attached.


    Best regards,

     

    • PSan1979's avatar
      PSan1979
      Icon for Helper II rankHelper II

      v-lid-msft  Thanks for the effort

       

      caterory column based on condition.

       

      If matdistnce> 6 then Far else Near

       

      grpid =distinctcount(grpid)

       

      i need something like this

       

       

       

       

      but currently i am getting 18 for both far and near. is something wrong with data model. i have used same joins as u used

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

        Hi PSan1979 ,

         

        We can try to use following measure to get desire result:

         

        Grpid =
        CALCULATE (
            DISTINCTCOUNT ( 'clus'[Grpid] ),
            FILTER ( 'Clus', 'Clus'[personid] IN DISTINCT ( 'Att'[personid] ) )
        )


        Best regards,

         

    • PSan1979's avatar
      PSan1979
      Icon for Helper II rankHelper II

      @v-lid-msft Thank you for the effort

      catering column depending on the condition.

      If matdistnce > 6 then Far else Near

      grpid -distinctcount(grpid)

      I need something like this.

      Capture.JPG

      but I'm currently getting 18 for both and close. it's a bad thing with the data model. I've used the same joints as I u used