Hey Everyone,
I have a dim table that I'm creating from unique values of an existing column in my data model.
I'm taking a field of brands from customers and creating a dim with the following format:
brand = column of brand names
customer = column of the customer name
customer_brand_key = a concatenation of customer and brand. The reason for this is because you can have the same brand across multiple customers, so this is an explicit key to make the join
example rows:
customer, brand, customer_brand_key
cust1, bubbles, cust1_bubbles
cust1, BuBBleS, cust1_BuBBleS
In the Power M Query, doing a 'remove duplicates' step these two are treated as 'different' and so they are both kept. This is expected behaviour for me. But, when I load the table into the data model, these two rows are treated as duplicates, so I get the error related to 'duplicates in a 1:many key'.
Why are they treated differently in these instances and what's the best approach to solving this issue? I can't lowercase everything because I must retain the case due to this being an embedded report that gets variables passed in the API for filtering on brand.
This is a common issue. M (query editor) is case sensitive, while DAX is not. You will need to make the case match (upper, lower, capitalize) before your remove duplicates.
Pat