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

Grow your Fabric skills and prepare for the DP-600 certification exam by completing the latest Microsoft Fabric challenge.

Reply
Rose__123
Helper II
Helper II

Many to many relationship - why?

Hi

I don't understand why this becomes a many-to-many relationship? Commission_exeption_table[customer_code] contains no repetitions, but salesInvoices[customer_code] does, I would think it should be a many to one relationship. Both are formatted as text. 

Rose__123_0-1629998001244.png

 

 

1 ACCEPTED SOLUTION

@Rose__123 The only way that I could replicate this was to have a blank row in Commission_exception. A blank customer_code. Do you have that?


Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
The Definitive Guide to Power Query (M)

DAX is easy, CALCULATE makes DAX hard...

View solution in original post

8 REPLIES 8
Greg_Deckler
Super User
Super User

@Rose__123 Check casing. M does not consider a and A the same but DAX does.


Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
The Definitive Guide to Power Query (M)

DAX is easy, CALCULATE makes DAX hard...

@Greg_Deckler, I double-checked, but it was fast since my Commission_exeption_table only contains two rows.  Any other ideas?😅 The only thing I can think of is the blank spaces of the Commission_exeption_table since these also appear (and should appear) in the salesInvoices[customer_code], but can that be? 

@Rose__123 It's really difficult to say without the ability to see the data. Since it is only two can you make up two that are equivalent to your two ID's? Is the only difference the number of spaces or ?


Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
The Definitive Guide to Power Query (M)

DAX is easy, CALCULATE makes DAX hard...

@Greg_Deckler sure! So right now they are like this:

 Commission_exeption_table

customer_code  Commission
1234562
123456783

 

and

 

 salesInvoices

DueDate   customerPurchaseOrderReference   CustomerID   customer_code
01-01-01335534-435643-3456112345678
02-02-01135534-435643-34561212344
02-02-01535534-434343-345623AB123
03-03-03435534-435213-3456432112345678

@Rose__123 Are both of your columns set to Text? Because if they are not, nothing will match.


Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
The Definitive Guide to Power Query (M)

DAX is easy, CALCULATE makes DAX hard...

@Greg_Deckler, yes both are formatted as text

@Rose__123 The only way that I could replicate this was to have a blank row in Commission_exception. A blank customer_code. Do you have that?


Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
The Definitive Guide to Power Query (M)

DAX is easy, CALCULATE makes DAX hard...

@Greg_Deckler, well not anymore 😂 It works, thank you very much for your time!

Helpful resources

Announcements
RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

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

MayPowerBICarousel1

Power BI Monthly Update - May 2024

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