Forum Discussion

Victor_YU's avatar
Victor_YU
New Member
1 year ago
Solved

Cost Allocation with three tables

Hello all,   I'm currently facing a complication that I can't solve and I'm kindly asking you to help me. I have three tables: clients table, sales table, and overheads table. The sales and overhe...
  • marcelsmaglhaes's avatar
    marcelsmaglhaes
    1 year ago

    Hey Victor_YU ,

    Maybe you can try something like that:

    AllocatedOverhead =
    CALCULATE(
    SUM('Overheads'[Amount]) *
    DIVIDE(
    SUM('Sales'[Sales]),
    CALCULATE(SUM('Sales'[Sales]), ALL('Client'))
    ),
    TREATAS(VALUES('Client'[Client Name]), 'Sales'[Client Name])
    )

    We use ALL('Client') to remove the filter from the Client table to calculate the total sales across all clients for proportional allocation, and  TREATAS ensures that the relationship between the Client table and the Sales table is respected when filtering.


    Let me know if this works for your scenario!