简体   繁体   English

Power BI 无法建立一对一关系,基数问题

[英]Power BI can't establish a one-to-one relationship, cardinality issue

I've got an issue with establishing relationships in Power Bi that I can't seem to solve.我在 Power Bi 中建立关系时遇到了一个我似乎无法解决的问题。 I've got two tables, Table 1 and Table 2. Table 1 has a column "Consignment ID" and Table 2 has a column "Consignment number".我有两个表,表 1 和表 2。表 1 有一列“寄售 ID”,表 2 有一列“寄售编号”。

The column "Consignment ID" will have a big list of numbers and "Consignment number" will have a smaller list, all of which should match with a corresponding number in "Consignment ID". “Consignment ID”列有一个大的数字列表,“Consignment number”将有一个较小的列表,所有这些都应该与“Consignment ID”中的相应数字匹配。 Therefore, I would like to establish a One-to-One relationship between these two columns and then use this relationship to extract the matching numbers from the "Consignment ID" column.因此,我想在这两列之间建立一对一的关系,然后使用这种关系从“寄售ID”列中提取匹配的编号。 However, Power BI is telling me that the "cardinality isn't valid for that relationship".但是,Power BI 告诉我“基数对该关系无效”。 I'm not sure why that is and I have no idea how to solve this problem.我不确定为什么会这样,我也不知道如何解决这个问题。

Does anyone have any thoughts on how to do that?有没有人对如何做到这一点有任何想法?

Thank you for your support!感谢您的支持!

To answer the question and to make it a visible solution:回答问题并使其成为可见的解决方案:

If you really want 1:1 relationship between Table1 and Table2, you can't have duplicates in any of the columns that are related, otherwise it is a N:1 or 1:N relationship.如果你真的想要 Table1 和 Table2 之间的1:1关系,你不能在任何相关的列中有重复,否则它是N:11:N关系。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM