Forum Discussion
PowerBI dealing with text case differently in M query compared to the data model
Hi gcam032
This is a classic Power BI quirk—what you're seeing is a case sensitivity mismatch between Power Query (M) and the Data Model (DAX).
Power Query (M) is case-sensitive by default. So cust1_bubbles and cust1_BuBBleS are treated as distinct values.
Power BI Data Model (DAX) is case-insensitive. When you load the data, it treats those two keys as duplicates, triggering a 1: cardinality violation* if you're trying to use them as a unique key in a relationship.
Best Practice Workarounds
1. Preserve Case but Create a Case-Insensitive Key for Relationships
Create two keys:
customer_brand_key_display → retains original casing for display and filtering
customer_brand_key_model → lowercase version used for relationships
// In Power Query
Add Column → customer_brand_key_model = Text.Lower([customer] & "_" & [brand])
Then:
Use customer_brand_key_model for joins and relationships
Use customer_brand_key_display for visuals and filters
This way, your embedded report can still pass case-sensitive filters, but the model remains stable.
Regards,
Ritesh
Community Champion
Please mark the answer if helpful so that it can help others
Dance-Sing with Data -BI & Analytics