Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
gcam032
Helper I
Helper I

PowerBI dealing with text case differently in M query compared to the data model

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.

1 REPLY 1
ppm1
Solution Sage
Solution Sage

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

 

Microsoft Employee

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.