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
deanmit
Regular Visitor

N to N Relationships between 3 tables

Hi, 

There's already a couple posts on this but didn't find one with my exact issue. 

I have 3 tables, one for my projects : 

projects.JPG

 

One for the Invoice table 

timelog.JPG

One for the association table between invoice<->projects : 

assoc.JPG

 

 

Goal is to get for each client the total time spent on a project with the total amount invoiced like this : 

result.JPG

I've been trying to add relationships using PowerBI but it only accepts 1 to N relationships. And as i have : 

123 / C001
123 / C002 

 

It doesn't allow me to create it. 

 

 

I've read in some posts that it could be possible to write a query as a workaround ? 
Is that correct ? And do you have any idea of the query that could be used ? 

 

Thanks!  

 

 

 

Error i'm getting (french) : 

error.JPG

1 ACCEPTED SOLUTION
v-frfei-msft
Community Support
Community Support

Hi @deanmit,

 

Here we can enable Composite models to create many to many relationship directly, the many to many  feature is available in both July and August release, you can download the new Power BI desktop from here. For more details, please refer to the online document. Also attached the pbix for your reference.

 

https://www.dropbox.com/s/wkz09eckysvx6qk/N%20to%20N%20Relationships%20between%203%20tables2.pbix?dl...

 

 

1.png2.png

 

Regards,

Frank

Community Support Team _ Frank
If this post helps, then please consider Accept it as the solution to help the others find it more quickly.

View solution in original post

3 REPLIES 3
v-frfei-msft
Community Support
Community Support

Hi @deanmit,

 

Here we can enable Composite models to create many to many relationship directly, the many to many  feature is available in both July and August release, you can download the new Power BI desktop from here. For more details, please refer to the online document. Also attached the pbix for your reference.

 

https://www.dropbox.com/s/wkz09eckysvx6qk/N%20to%20N%20Relationships%20between%203%20tables2.pbix?dl...

 

 

1.png2.png

 

Regards,

Frank

Community Support Team _ Frank
If this post helps, then please consider Accept it as the solution to help the others find it more quickly.

Hello @v-frfei-msft

 

Thanks for your reply. I installed latest version, enabled many to many relations in the options and gave it a try ! 

I just don't get how you have those results. Here's what i get : 

result-n.JPGqsqsd

Where did you actually put your pbix to see how you did that??? 
I don't seem to be able to find it :'(

 

Regards, 

Dean

@v-frfei-msft, working Smiley Happy

 

The difference is the 1-1 relationship between "association" and "invoice" table. I had a 1-N. 

 

Thanks a lot for the pbix ! 

 

 

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.