Please advise how to allocate the warehouse charges to respective departments.

I have 2 tables as attached in the above. One table, on the left, shown the inventory amount transferred from warehouse(WH) to various departments and the other table, on the right, was the warehouse charges incurred by the respective warehouses for the departments. Warehouse charge, from the right table, is required to be allocated to departments, based on the amount of inventory that each department has drawn from the warehouse. For eg, warehouse charges of WH1 to be allocated to department 1 is $36,857 (ie ($100,666/565,490) * $207,046). Please advise which measure I should create to allocate the warehouse charges to departments.

Storage charge by warehouse (table at right bottom), was not allocated to departments. I need to allocate warehouse charges to departments based on the transfer amount. Please advise which measure I should create to allocate the warehouse charges to departments.

I would like to allocate the respective Warehouses’ Storage chg to the Depts (100-104) in accordance to the proportion of Transfer amt. E.g. 207,046 to be allocated to Dept 100: (207, 046 x 100,666/565,490), Dept 101: (207,046 x 200,250/565,490), etc. Let me know if you need further clarification. Thanks.

I managed to get the answer by adding the measure as follow:-

Allocated = DIVIDE( SELECTEDVALUE(StkTrs[Transfer amt]),[Denominator],0)*[Storage Chg by WH]

The results as follow:-

Noted that no summation on the allocated storage charges column. Please advise how I should refine the above measure so that total amount of allocated storage charges could be reflected.

I have created a few videos around how to sort totals.

See below

The key is to really understand the context of the calculation.

Now if we look above you already have an allocation measure that has created the total. So the idea is to work out a way to replicate this in the final measure.

Would I would try first is to wrap your latest measure in this, I mean the measure - Allocated storage chg.