Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

July 28 - August 9 | Final Round of the Power BI Dataviz World Championships. This is your chance. Learn more

Reply
Gelain
Frequent Visitor

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.

 

1 ACCEPTED SOLUTION
v-jiascu-msft
Microsoft Employee
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" )

Unique column values.jpg

 

 

 

 

 

 

 

 

 

 

 

 

 

Best Regards!

Dale

Community Support Team _ Dale
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

6 REPLIES 6
v-jiascu-msft
Microsoft Employee
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

Community Support Team _ Dale
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Thanks a lot for the help!

v-jiascu-msft
Microsoft Employee
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" )

Unique column values.jpg

 

 

 

 

 

 

 

 

 

 

 

 

 

Best Regards!

Dale

Community Support Team _ Dale
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Wout
Helper I
Helper I

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

 

 

Gelain
Frequent Visitor

Hello,

 

The data source is SQL Server. Would you have any way to solve this problem?

 

Thank you.

Do you have the permission to customize the SQL database? 

Add a new column to your table: http://www.1keydata.com/sql/alter-table-add-column.html

 

Add (and remove current PK) new PK & Auto incremental to the new column.

https://stackoverflow.com/questions/11794659/add-primary-key-to-existing-table

 

P.s. Test it first on a local/test SQL database.

Helpful resources

Announcements
Fabric Community Sticker Design Challenge Barcelona Carousel

Fabric Community Sticker Challenge - Barcelona 2026

If you love stickers, then you will definitely want to check out our community sticker challenge, Barcelona edition!

July Power BI Update Carousel

Power BI Monthly Update - July 2026

Check out the July 2026 Power BI update to learn about new features.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.

Top Solution Authors