Weighted Average Expression

  • Hi,

    I need some help to get the sum of weighted average to display correctly on my matrix.

    Using the following test data:

    ProductQuantity PriceQuantityXPrice

    Apple10000.150

    Banana1000.5150

    Orange2000.75100

    [/Code]

    I have the following expression:

    =Sum(Fields!QuantitytXPrice.Value/Fields!Quantity.Value)))

    The problem is that it is giving me the sum of the Price (1,35) where I want the weighted sum of the expression (0.23) if

    if that makes sense.

    The attached excel sheet describes my expected result.

    Any suggestions would be appreciated.

    G

  • The formula should look something like this :

    =SUM(Qty * Price) / Qty

  • Hi,

    Thanks for taking a look.

    That is essentially the formula I have in place. However in my matrix totals I'm getting 1.35 for total price where I would like to get the weighted average (0.23) which is what I get in excel using that formula.

    G

  • Grinja (6/29/2011)


    Hi,

    Thanks for taking a look.

    That is essentially the formula I have in place. However in my matrix totals I'm getting 1.35 for total price where I would like to get the weighted average (0.23) which is what I get in excel using that formula.

    G

    You're not using the correct column.

    I've redone it in excel and it balances out perfectly.

  • Thanks.

    I was also adapting the expression for the sub total which put the sum over the entire expression.

    My final expression:

    =SUM(Fields!Quantity.Value*Fields!Price.Value / SUM(Fields!Quantity.Value))

    Cheers for the feedback!

    G

Viewing 5 posts - 1 through 4 (of 4 total)

You must be logged in to reply to this topic. Login to reply