Forum Discussion

Gelain's avatar
Gelain
Frequent Visitor
9 years ago
Solved

Unique column values

Hi,

The FCFO table contains the CODCFO column where customer and vendor codes are recorded. Therefore, a relationship error occurs between the TMOV and FCFO columns because one of the columns must have unique values. Apparently the problem arises in the way records are written:
000001 - Customer A 000002 - Customer B 000001 - Supplier A 000002 - Supplier B
Code records are repeated for customers and vendors, causing the error. Through the query editor, I filtered only the clients, yet the error continues.
Could someone help me how to solve?
Grateful.

 

  • Hi Gelain,

     

    How is the real data like? If it likes the sample you posted here, we could create two new table with these formulas. Finally we can create relationship. If not, could you please post a sample?

     

    Customer =
    FILTER ( 'Table1', LEFT ( 'Table1'[Name], 8 ) = "Customer" )
    Supplier =
    FILTER ( 'Table1', LEFT ( 'Table1'[Name], 8 ) = "Supplier" )

     

     

     

     

     

     

     

     

     

     

     

     

     

    Best Regards!

    Dale

6 Replies

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

    Hi Gelain,

     

    Could you please mark the proper answer if it's convenient for you? That will be a help to others.

     

    Best Regards!
    Dale

    • Gelain's avatar
      Gelain
      Frequent Visitor

      Thanks a lot for the help!

  • Mm recognizable. Can you customize the data source? The easiest way is to add an unique ID/primary key.

     

     

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

    Hi Gelain,

     

    How is the real data like? If it likes the sample you posted here, we could create two new table with these formulas. Finally we can create relationship. If not, could you please post a sample?

     

    Customer =
    FILTER ( 'Table1', LEFT ( 'Table1'[Name], 8 ) = "Customer" )
    Supplier =
    FILTER ( 'Table1', LEFT ( 'Table1'[Name], 8 ) = "Supplier" )

     

     

     

     

     

     

     

     

     

     

     

     

     

    Best Regards!

    Dale