Forum Discussion
Anonymous
7 years agoNot applicable
DAX Weighted Averages
Hi everyone, I'm trying to come up with a table in a report that has product line in the rows and weighted average product cost as the value. I have a dimension table with unique product number, ...
- Anonymous7 years ago
Hi, I can't really upload the file because of proprietary data, but I figured out the code on my own. Basically, the DAX reads as follows:
WtdAvgCost = DIVIDE(
SUMX(SalesTable, SalesTable[SalesQuantity] * RELATED(ProductTable[ProductCost])),
SUMX(SalesTable, SalesTable[SalesQuantity]),
0)
Ashish_Mathur
Super User
7 years agoHi,
Share the link from where i can download your file.