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

Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.

Reply
monktrain
Frequent Visitor

Add column to table from another table where there is a many to many relationship

I have a Sales Order Lines table and a Forecast table.  There is a Part Category column in the Sales Order Lines table that I need in the Forecast table so I can show a forecast by Part Category.  There is a many-to-many relationship with the part numbers because the same part number may be on many sales order lines, and the part number is also forecast for several different months.  I have tried various versions of LookupValue, NATURALLEFTOUTERJOIN and FILTER and I just can't seem to get there.  Can anyone help?  Here is a basic layout of my tables:

LookupValues.jpg

I have also tried to calculate the sum of the forecasted amount (no shown) in a measure, with no success. This is my measure for that:

Category Monthly Goal = sumx(filter(Forecast,Forecast[ForecastStartDate]=date(2020,3,1) && MAX(SalesOrderLines[Category]) = "Wheel"),[ForecastedAmount])
That does not throw up an error, but I do not get a value.
 
Thanks,
David
5 REPLIES 5
v-juanli-msft
Community Support
Community Support

Hi @monktrain 

What is your measure [ForecastedAmount]?

Which tables does the measure use?

 

Best Regards

Maggie

Sorry, the [ForecastedAmount] is actually in the Forecast table.  I forgot to put that in there. 

Thank you.

Hi @monktrain 

Add [amount] from "forecast table" to the table visual, it would sum the [amount] based on the column [Category].

What's wrong?

What is the expected result do you like?

Capture5.JPG

Best Regards

Maggie

Mariusz
Community Champion
Community Champion

Hi @monktrain 

 

You can use a budget pattern for your scenario, as per below.
https://www.daxpatterns.com/budget-patterns/

 

Also, it's considered as a best practice to avoid many to many, so you can create Product Table and join both tables on 1:*

 

Best Regards,
Mariusz

If this post helps, then please consider Accepting it as the solution.

Please feel free to connect with me.
LinkedIn

 

Thank you.  I will check this out.  

 

I would love to avoid the many-to-many relationship.  Unfotunately, this information is coming from an ERP system where I cannot change the data entities.  

Helpful resources

Announcements
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

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

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.