Forum Discussion

Fistachpl's avatar
Fistachpl
Icon for Helper III rankHelper III
7 months ago
Solved

Preparing a pricelist - products and assemblies

Hello,   i have a problem as I want to prepare a simple pricelist but the problem is complex for me which is driving me mad a bit 😉   I have Tables with data:    1) with prices for basi...
  • donbuser's avatar
    7 months ago

    This is a great example of where the challenge is less about the formula itself and more about how the model is structured.

    For assemblies, what you’re really trying to do is iterate through each component in the assembly, multiply the quantity by the product price, and then sum everything up.

    In DAX terms, that usually means using something like SUMX over your assembly configuration table, where you can pull in the related product price for each component.

    Conceptually, it would look something like:

    Loop through each row in the assembly configuration
    For each component:
    get the quantity
    get the related product price
    Multiply and sum

    So your assembly part of the measure would follow that pattern:

    Assembly Price =
    SUMX(
    'Assembly configurations',
    'Assembly configurations'[Quantity] *
    RELATED('Basic product pricelist'[New Price])
    )

    Then your SWITCH logic can call this when Type = "Assembly".

    If this isn’t returning results yet, it’s usually a sign that the relationship path between:

    assembly → configuration → product → price

    isn’t fully connected or active in the model.

    One thing I’d double check is whether your model allows the filter from the selected assembly to correctly flow into the configuration table and then back to the product price. That relationship flow is what makes the calculation work.

    I’ve run into similar setups where the DAX looked right, but the real issue was the relationship direction or missing link in the chain.