March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Early bird discount ends December 31.
Register NowBe one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now
Hi everyone,
I've been stuck on this error for some days now... I want to see the number of hypermarkets and supermarkets that have this or this item:
For the supermarkets it works perfectly but for the hypermarkets it sums up everything when I use the "assortment code" field...
Both "Supermarket" and "Hypermarket" tables have exactly the same format and are structured the same way.
Despite being active, it's like the relation between the two tables "Assortment" and "Hypermarket" is not working.
All the data used in the graphics are from the unique value tables.
Here is the PBI file where I removed all the confidential informations.
Thank you.
Solved! Go to Solution.
Hi @fcarro
The Hypermarket[Assortment Code] column seems to have an extra space at the end of the code. Relationships need an exact match to work. I added a calculated column using LEN('Hypermarket'[Assortment code]) and it was returning a value of 4 (the other tables were returning 3.
I created a new calculated column in the Hypermarket table to test as follows
When I changed the relationship to use this new column, it worked.
I recommend you fix the problem in the query editor. Highlight the column in question and use the "Clean" and "Trim" options to tidy up. Probably best to do this on both tables.
Hi @fcarro
The Hypermarket[Assortment Code] column seems to have an extra space at the end of the code. Relationships need an exact match to work. I added a calculated column using LEN('Hypermarket'[Assortment code]) and it was returning a value of 4 (the other tables were returning 3.
I created a new calculated column in the Hypermarket table to test as follows
When I changed the relationship to use this new column, it worked.
I recommend you fix the problem in the query editor. Highlight the column in question and use the "Clean" and "Trim" options to tidy up. Probably best to do this on both tables.
Thank you but I just found the solution 10 minutes ago !
While double checking again my data I've seen this extra space that was hiding...
Thanks for the formula, next time I'll start by trimming my values.
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!
Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.
Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.
User | Count |
---|---|
124 | |
87 | |
85 | |
70 | |
51 |
User | Count |
---|---|
205 | |
153 | |
97 | |
79 | |
69 |