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

A new Data Days event is coming soon! This time we’re going bigger than ever. Fabric, Power BI, SQL, AI and more. Don't miss out.

Reply
X3svfdB1HOjKYc0
Regular Visitor

Trouble With Links/Formulas

I have two tables. The first table is a list of containers, charge codes and amounts. See sample table with charges totalling 1400.

 

X3svfdB1HOjKYc0_1-1658764289790.png

 

The second table is a list of containers, order lines and physical volume. There is a many-to-many relationship between these tables.

 

X3svfdB1HOjKYc0_2-1658764328546.png

 

I want to setup a formula that will allocate the freight costs pro rata based on the volume as show below.

 

X3svfdB1HOjKYc0_3-1658764540046.png

I just can't seem to get the bridge table and formulas right for this. Any help would be very much appeciated.

 

I also want to set this up in a way where I can link addition information to the container (many from this results table to a single key in the container table) and also additional order information (again, many from this results table to a single key in the order table). I don't think this will be an issue but just wanted to make sure that any solution keeps this in mind.

 

3 REPLIES 3
X3svfdB1HOjKYc0
Regular Visitor

Thanks for your help getting the inital table merged. This is already a big step forward. 

 

Edited and updated from earlier post. I am now getting a result that is not an error, however the values seem to be divided by the volume an extra time.

 

X3svfdB1HOjKYc0_0-1658862566380.png

I could take the result and multiply it again by the volume to force the correct solution, but, is there a more elegant way to get the original formula?

Anonymous
Not applicable

Hi @X3svfdB1HOjKYc0,

Can you please share a pbix or some dummy data that keep raw data structure with expected results? It should help us clarify your scenario and test to coding formula.

How to Get Your Question Answered Quickly  

Regards,

Xiaoxin Sheng

amitchandak
Super User
Super User

@X3svfdB1HOjKYc0 , Merge these two tables in power Query

 : https://radacad.com/append-vs-merge-in-power-bi-and-power-query

 

a new column in DAX =

divide([Amount] , sumx(filter(Table, [Container $] = earlier( [Container $]) && [Charge] = earlier( [Charge]) ), [Volume] ))

 

 

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Helpful resources

Announcements
Fabric SQL PBI Data Days

Data Days 2026 coming soon!

Sign up to receive a private message when registration opens and key events begin.

New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.