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

The Power BI DataViz World Championships are on! With four chances to enter, you could win a spot in the LIVE Grand Finale in Las Vegas. Show off your skills.

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
Feb2025 Sticker Challenge

Join our Community Sticker Challenge 2025

If you love stickers, then you will definitely want to check out our Community Sticker Challenge!

Jan NL Carousel

Fabric Community Update - January 2025

Find out what's new and trending in the Fabric community.