cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Prodingero
New Member

Problem with 1:n relationship

 I want to relate two tables 'OE' and and 'Salary' with  1:n relationship.
'OE' contains the column with unique Key OE3 and 'Salary' contains the column OE3.
If i want to activate the relationshop, there comes the meesage that the 1:n is not possible.
What´s the reason?  

1 ACCEPTED SOLUTION
AntrikshSharma
Community Champion
Community Champion

@Prodingero Your OE3 column in OE contains duplicates?

View solution in original post

4 REPLIES 4
Prodingero
New Member

No, last step creating table 'OE' ist deleting duplicates.

AntrikshSharma
Community Champion
Community Champion

@Prodingero Your OE3 column in OE contains duplicates?

sorry, you are right, there were duplicates. Problem was there were two values, one without last <Space> one with last <space>. I have found it. Interestingly in Excel and Power BI it is be used as identic value. Only powerquery knows, that therae ar two different values. Now I have deleted the last space, delted duplicates and now I can use 1:n relationship.

Yup, I have encountered this with SQL Server, two values 'Contoso' and 'Contoso   ' are considered the same in SQL Server, but Power Query doesn't considers this so it shows both Contoso in the drop down.

DECLARE @test TABLE (Brand VARCHAR(20))
	
INSERT INTO @test 
VALUES 
('Contoso'), 
('Contoso ' ), 
('Contoso    ')

SELECT DISTINCT * 
FROM @test

 

Helpful resources

Announcements
Join Arun Ulag at MPPC23

Join Arun Ulag at MPPC23

Get a sneak peek into this year's Power Platform Conference Keynote.

PBI Sept Update Carousel

Power BI September 2023 Update

Take a look at the September 2023 Power BI update to learn more.

Learn Live

Learn Live: Event Series

Join Microsoft Reactor and learn from developers.

Dashboard in a day with date

Exclusive opportunity for Women!

Join us for a free, hands-on Microsoft workshop led by women trainers for women where you will learn how to build a Dashboard in a Day!

Top Solution Authors
Top Kudoed Authors