简体   繁体   中英

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

I have created a data model in Excel 2013 which consists of two queries:

  1. Table with 1 million rows of data. One of columns stores information on CUSTOMER_ID.
  2. Table with 600 rows of data. This is a list of distinct CUSTOMER_IDs, but only VIP accounts.

I wanted to create a one to many relationship between these CUSTOMER_ID columns but when I try to do so, I get the following error:

============================
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)

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

Thank you in advance for the help.

To me it appears that the Customer_ID is formatted as Text in the one table, but not in the other. If so, is there a way to have the field formatted the same way in both sources?

If not, you may be able to get around it by using the FORMAT function in a calculated column (in the table that has numbers formatted as text). You could then use that calculated column for your join/relationship.

Some info on the Format function: http://social.technet.microsoft.com/wiki/contents/articles/685.power-bi-dax-text-functions.aspx

Edit: Also, I just realized that this error may be caused if you have a text value in a column that is numeric. You may need to review your data to see if that scenario exists.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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