SSAS Error: Errors in the OLAP storage engine: A duplicate attribute key has been found when processing
Full error message text is "SSAS Error: Errors in the OLAP storage engine: A duplicate attribute key has been found when processing: Table: <tablename>, Column: <columnname>. Value: <value>. The attribute is <attributename>."
Applies to: SQL Server Analysis Services (all versions), tabular and multidimensional models
This error occurs during processing, when a duplicate key is found for a given attribute.
Attribute keys are used to uniquely identify each member of an attribute. This is especially important when two or more attributes have the same value. For example, suppose there are two employees with a last name of Smith. In this case, you might want the attribute key for LastName to be EmployeeID so that each person is considered independently, and imported as separate rows during processing.
The attribute key is set through the KeyColumn in the attribute properties page. As the previous example indicates, KeyColumn is often different from the Name column. The Name column provides the value seen by the application user (such as LastName), and the KeyColumn is used to resolve ambiguity.
Cause and resolution
The duplicate attribute key error is likely to occur in the following situations. In most cases, the recommended solution is to change the KeyColumn by setting it to a unique attribute, or by creating a composite key that results in a unique value when multiple attributes are evaluated as a unit.
1) KeyColumn uses the default value, which means it is based on a column in the DSV, on a column that happens to contain duplicate values. This means that an attribute for City might have both Name and KeyColumn set to City. Whenever two or more cities share the same key, the duplicate key error will occur.
2) A hierarchy (such as Year | Month | Day, Country | Province | City, or Category | Subcategory | Product) is not unique at the leaf level. For example, a City might repeat multiple times throughout the data. To resolve the ambiguity, you should create a composite key that includes Country and Province to distinguish each city. For example, a city named Redmond exists in both Washington state and Oregon. Creating a composite key that incorporates state is sufficient to distinguish between each one (USA.Washington.Redmond] and [USA.Oregon.Redmond]).
Note: Date hierarchies are often subject to the duplicate attribute key error. Be sure to create composite keys at the Day level that specify Year and Month to ensure that keys are unique throughout the table.
Always create the composite key for the lowest level attribute in the hierarchy. In our example, the composite key is created on City. For more information on creating a composite key, see http://technet.microsoft.com/en-us/library/ms175461.aspx
3) Null or blank values can cause the error. If the error message specifies ‘’ for the value, it is an indication that the duplicate key is a null.
4) Collation, case-sensitivity, data type, or data length are causing the error. Analysis Services and the relational database providing the data might have different collations, different settings on case-sensitivity, or different column lengths, truncating values that would otherwise be unique.
5) Partitions contain duplicate rows, including duplicate keys. If rows overlap, with two or more partitions containing the same row, this error will occur. Check each partition to ensure that attribute keys are unique across the dimension table, not just within each partition.
More information
To get more information, see this curated answer for additional blog posts, forum posts, and other links.