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

Score big with last-minute savings on the final tickets to FabCon Vienna. Secure your discount

Reply
jzhao
Frequent Visitor

General Best Practice for Many to Many relationship?

 

Originally I have a data with many to many relationship that look like the picture below:

jzhao_0-1698798701318.png

I am told this is a bad practice, so I created a look up table that look like this.

jzhao_1-1698799105272.png

But the problem with look up table is that custtomer nnumber in table1 does not filter up to the lookup table and then filter down to table2. 

 

So I decide to enable by directional filter that look like this.

jzhao_2-1698799135824.png

But bi-directional filter is also a bad design, can anyone tell me how you would design your datamodel if you want to subtract cost from sales for the same customer number.

1 REPLY 1
FreemanZ
Super User
Super User

i have two ideas in mind:

1) you bring the cost column to table1, by merging table1 with table2 in Power Query. Then you have everything in one table - table1. 

2) you write plot the visuals with customer number of the lookup table and a measure like: 

Profit = SUM(table1[Sales])-SUM(table2[Cost])

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

Check out the August 2025 Power BI update to learn about new features.

August 2025 community update carousel

Fabric Community Update - August 2025

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