Forum Discussion

i_kafali's avatar
i_kafali
Helper II
7 years ago
Solved

Weighted Average for only one column

  Dear all,   I have below fields Department and Product and numbers for volume and sales price   What i want to add is another measure which calculates only departments average unit sales price...
  • v-cherch-msft's avatar
    v-cherch-msft
    7 years ago

    Hi i_kafali

     

    You may try to create below measures:

    Volume*Unit Sales Price =
    CALCULATE ( SUM ( Table1[Volume (kg)] ) * SUM ( Table1[Unit Sales Price] ) )
    
    Measure =
    SUMX ( ALLEXCEPT ( Table1, Table1[Department] ), [Volume*Unit Sales Price] )
        / CALCULATE (
            SUM ( Table1[Volume (kg)] ),
            ALLEXCEPT ( Table1, Table1[Department] )
        )
    

     

    Regards,

    Cherie