Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.
Hi Power BI Experts,
I am looking to create the weighted average instead of regular average. I do have sales budget with margin budget available for the calculation. i am looking to get the weighted average of either the margin or sales. The idea is that each warehouse sales budget is not the same therefore it should be considerd for the weighted average calculation. Please see the table below.
Solved! Go to Solution.
The basic pattern looks like this:
AvgMargin =
DIVIDE (
SUMX ( Table1, Table1[Margin] * Table1[Sales] ),
SUMX ( Table1, Table1[Sales] )
)
If you want the average sales weighted by margin rather than average margin weighted by sales, swap the roles of Margin and Sales. In this case, that can be done just by changing the denominator to use Margin instead of Sales (since they're both already present in the numerator, swapping the columns there doesn't change anything since multiplication is commutative).
What is the result you're expecting? Average Margin weighted by Sales?
Yes average Margin weighted by sales or vice versa.
The basic pattern looks like this:
AvgMargin =
DIVIDE (
SUMX ( Table1, Table1[Margin] * Table1[Sales] ),
SUMX ( Table1, Table1[Sales] )
)
Thank you Sir. That worked. What if i will like the weighted average amount. do i just use the same function but different denominator?
If you want the average sales weighted by margin rather than average margin weighted by sales, swap the roles of Margin and Sales. In this case, that can be done just by changing the denominator to use Margin instead of Sales (since they're both already present in the numerator, swapping the columns there doesn't change anything since multiplication is commutative).
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
111 | |
100 | |
80 | |
64 | |
58 |
User | Count |
---|---|
146 | |
110 | |
93 | |
84 | |
67 |