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

Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started

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
Europe Fabric Conference

Europe’s largest Microsoft Fabric Community Conference

Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.

Power BI Carousel June 2024

Power BI Monthly Update - June 2024

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

RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.