Forum Discussion
Anonymous
5 years agoNot applicable
Weighted Average Calculation
Hey guys! I'm trying to formulate an weighted average for a product data. I have 4k rows of differents IDs divided by 9 categories (prod1 to prod9), each one with a value of time. I need an weighte...
- 5 years ago
I'm working with my assumption and came up with this...
Weighted Average Product Time = VAR AllProducts = CALCULATETABLE( VALUES(Products[Product]), ALL(Products) ) VAR TotalProductCount = CALCULATE( [Product Count], ALL(Products) ) RETURN DIVIDE( SUMX( AllProducts, [Product Count] * [Total Product Time] ), TotalProductCount, BLANK() )Here's the results
Hope this helps! 🙂
littlemojopuppy
5 years agoCommunity Champion
Anonymous one more question: how is the weighing calculated? I'm assuming
(product total count) * (product time) / (total product count)
littlemojopuppy
5 years agoCommunity Champion
I'm working with my assumption and came up with this...
Weighted Average Product Time =
VAR AllProducts =
CALCULATETABLE(
VALUES(Products[Product]),
ALL(Products)
)
VAR TotalProductCount =
CALCULATE(
[Product Count],
ALL(Products)
)
RETURN
DIVIDE(
SUMX(
AllProducts,
[Product Count] * [Total Product Time]
),
TotalProductCount,
BLANK()
)
Here's the results
Hope this helps! 🙂