Forum Discussion

kirbynguyen's avatar
kirbynguyen
Helper II
5 years ago
Solved

Weighted Average DAX

Hello,   I am trying to use a measure to find the weighted average based on the values in another column per product. My data looks like this:   Product   Date   Value   WeightValue A ...
  • jdbuchanan71's avatar
    5 years ago

    kirbynguyen 

    Give something like this a try, it's 3 measures but that keeps in clean in my mind.

    1. Calculate all the weighted values

     

    Weighted Values = SUMX ( 'Your Table', 'Your Table'[Value] * 'Your Table'[WeightValue] )

     

    2. Get the sum of all the weights

     

    Total Weights = SUM ( 'Your Table'[WeightValue] )

     

    3. Get the weighted average value

     

    Weighted Average Value = DIVIDE ( [Weighted Values], [Total Weights] )