Forum Discussion
Many to Many - No Duplicates?
Bear in mind that duplicates in the query editor and duplicates in the model aren't exactly the same since M is case-sensitive and DAX is not. Is it possible that you have some SKUs that differ only by case?
Try clean, trim, and upper case and then remove nulls and remove duplicates on the SKU column.
Text.Upper(Text.Trim(Text.Clean([SKU])))
- Thigs4 years agoHelper IV
Hi! Thanks for the tip - unfortunately, no, this can't be the problem, as all the SKUs are numeric only, which can't have case sensitivity.
- Sergii242 years agoSuper User
Hi Thigs, try to do the following:
- Load your data to PowerBI
- go to "Table view", select the table you need and look at column profile
- Do you have the same value in number of rows for "Table" and SKU "column"? If not, create a table visual with 2 columns: SKU and Count SKU, then sort it in descending order by SKU number to find the duplicate
If it doesn't help, please send us some statistic of your both dimensional and fact tables as well as details of the column you use as a key (like in the screenshot above).
Could it be that you have any other relationship in your data model that doesn't allow you to create one-to-many relationship?
- jaadame3 years agoNew Member
I had the same issue and this worked for me, thanks a lot for the explanation!!
- ASTownsend2 years agoRegular Visitor
Thank you Alexis, I couldn't figure it out! Yes, it was due to M being case-sensitive and DAX not, and your solution worked perfectly.