繁体   English   中英

PowerPivot-无法创建一对多关系-错误:类型不匹配

[英]PowerPivot - Cannot create one to many relationship - Error: Type mismatch

我在Excel 2013中创建了一个数据模型,该模型包含两个查询:

  1. 具有一百万行数据的表。 列之一存储有关CUSTOMER_ID的信息。
  2. 具有600行数据的表。 这是不同的CUSTOMER_ID的列表,但只有VIP帐户。

我想在这些CUSTOMER_ID列之间创建一对多关系,但是当我尝试这样做时,出现以下错误:

============================
Error Message:
============================

The following system error occurred:  Type mismatch. 
Cannot convert value 'D: ControlTechSK4633-1' of type Text to type Integer.

----------------------------
The following system error occurred:  Type mismatch. 
Cannot convert value 'D: ControlTechSK4633-1' of type Text to type Integer.


============================
Call Stack:
============================

   at Microsoft.AnalysisServices.BackEnd.DataModelingSandbox.ExecuteCaptureLogAndProcessResults(OperationType type, Boolean cancellable, Boolean raw, Boolean raiseEvents)
   at Microsoft.AnalysisServices.BackEnd.DataModelingSandbox.ExecuteAMOCode(OperationType type, OperationCancellability cancellable, AMOCode code, Boolean raiseEvents)
   at Microsoft.AnalysisServices.BackEnd.SandboxTransaction.CommitUpdates()
   at Microsoft.AnalysisServices.BackEnd.SandboxTransaction.CommitInternal(Boolean finalCommit)
----------------------------
   at Microsoft.AnalysisServices.BackEnd.SandboxTransaction.CommitInternal(Boolean finalCommit)
   at Microsoft.AnalysisServices.Common.RelationshipController.CreateRelationship(DataModelingColumn sourceColumn, DataModelingColumn relatedColumn)
   at Microsoft.AnalysisServices.Common.RelationshipController.formCreateRelationshipDialog_Confirming(Object sender, EventArgs e)
   at Microsoft.AnalysisServices.Common.CreateRelationshipDialog.buttonOK_Click(Object sender, EventArgs e)

============================

预先感谢您的帮助。

在我看来,在一个表中,Customer_ID的格式设置为文本,而在另一表中则没有。 如果是这样,是否可以在两个源中以相同的方式格式化字段?

如果不是这样,则可以通过使用计算列(在具有数字格式为文本格式的表中)中的FORMAT函数来解决此问题。 然后,您可以使用该计算出的列作为联接/关系。

有关“格式”功能的一些信息: http : //social.technet.microsoft.com/wiki/contents/articles/685.power-bi-dax-text-functions.aspx

编辑:另外,我只是意识到,如果在数字列中有文本值,则可能会导致此错误。 您可能需要查看数据以查看是否存在该情况。

暂无
暂无

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

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