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! 🙂
Ashish_Mathur
5 years agoSuper User
Hi,
Try these measures:
Total time = SUM(Data[Time])
Product count = COUNTROWS(Data)
Measure 2 = SUMX(VALUES(Data[Product]),[Total time]*[Product count])/[Product count]
Hope this helps.
littlemojopuppy
5 years agoCommunity Champion
Ashish_Mathur not only did I offer a solution five hours ago, someone else offered essentially the same solution three hours ago. Your input was warranted?