Forum Discussion

JENS's avatar
JENS
Frequent Visitor
9 years ago
Solved

Regarding relation between 2 table , must have unique values

Im new at this, and have tryed to read the other solutions regarding the same queastion.

error : You Can´t create a relationship between these two columns because one of the columns must have unique values

 

The left table  is where we have the absence on employees ( one person have 17 days, and the emplid is there 17 times)

The right table is where we have the employee stamdata (name, adress and so on) end the emplid is there only once.

 

In SQL server 2008 r2, there is no issue to relate these fields. what is the best way to set this up. 

  • Anonymous's avatar
    Anonymous
    9 years ago

    Hi JENS

     

    I assume you tried to establish a relationship between both emplid columns.

    If [EMPLID] in EMPLTABLE is unique & there are no nulls in EMPLTABLE[EMPLID], it should work.

     

     

     

5 Replies

  • Anonymous's avatar
    Anonymous
    Not applicable

    Hi JENS

     

    I assume you tried to establish a relationship between both emplid columns.

    If [EMPLID] in EMPLTABLE is unique & there are no nulls in EMPLTABLE[EMPLID], it should work.

     

     

     

    • ovetteabejuela's avatar
      ovetteabejuela
      Impactful Individual

      Why not make a unique employee table if none of the two are.

      • JENS's avatar
        JENS
        Frequent Visitor

        that might work, but im unsure how to make it.

    • JENS's avatar
      JENS
      Frequent Visitor

      I have made sure that there isent any null, and empltable.emplid has 9307 pcs. of unique numbers 100001,100002 and so on.

      it still dont work

      • v-sihou-msft's avatar
        v-sihou-msft
        Microsoft Employee

        JENS

         

        As you said the right table is the dimension table which contains unique empid values. Please delete the data source and re-import the table into Power BI Desktop to see if it still works.

         

        If the issue still persists, please create a support ticket.

         

        Regards,