Another issue you might want to check is
Another issue you might want to check is if the attribute value contains spaces. For instance, SSAS will consider "Hello" and "Hello " as the same value (thus give duplicate key error message). In this case, you should either remove the spaces in the source data or change the "Trimming" in SSAS design to "None"