Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.
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, product line (product lines are composed of many product numbers), and product cost, and a fact table (linked by unique product number) with unique product number and sales quantities. I want the weight of the weighted average to be set by sales quantities. Any help with the DAX formula would be much appreciated!
Solved! Go to Solution.
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)
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)
Hi,
Share the link from where i can download your file.
User | Count |
---|---|
101 | |
90 | |
79 | |
70 | |
70 |
User | Count |
---|---|
112 | |
96 | |
96 | |
75 | |
72 |