Forum Discussion

JeremyCooper's avatar
JeremyCooper
New Member
10 years ago
Solved

Calculating the sum of dynamically weighted values

  When calculating weighted values for a weighted average, how can we calculate a value which is the sum of those weighted values?   In the example below: Total Quantity = SUM(Sheet1[Quantity]) ...
  • Sean's avatar
    Sean
    10 years ago

    JeremyCooper we need to know how your data is set up in the source

     

    Here's another Measure which also worked for me - but again I don't know how your data is set up so... don't know if will work for you

     

    Quantity Weighted Average NEW =
    IF (
        COUNTROWS ( VALUES ( 'Sheet1'[Name] ) ) = 1,
        [Proportion of Total Selected Quantity] * [Avg X],
        SUMX (
            VALUES ( 'Sheet1'[Name] ),
            [Proportion of Total Selected Quantity] * [Avg X]
        )
    )

     

    See Picture...