Forum Discussion
Dynamic Weighted Average
Hi admiralman
I create new measures here to get what you want.
TotalCount1 =
CALCULATE (
SUM ( Rentals[Count] ),
FILTER (
ALL ( Rentals ),
[Location] = SELECTEDVALUE ( Rentals[Location] )
&& [Month] = SELECTEDVALUE ( Rentals[Month] )
)
)
Weighting1 = MAX([Count])/[TotalCount1]
WeightedCost1 = SUM(Rentals[Rent])*[Weighting1]
WeightedCost2 = SUMX(Rentals,[WeightedCost1])
There are two tables above, they are different from the aggregation of each columns, please look at the pbix to find the difference.
Best Regards
Maggie
- admiralman8 years agoAdvocate II
v-juanli-msftI have updated this post becuase what I thought didn't work in the solution seems to work fine. However, the key is that I am going to want to be able to put this in a chart and graph by month with a totla price per month...not by model. When I select multiple months this does not seem to work.
- admiralman8 years agoAdvocate II
I have also found that if you add a third model for NY in Jan that count will be included in the total count even if not selected in the slicer.
- v-juanli-msft8 years agoCommunity Support
Hi admiralman
If you want the Totalcount calculates based on selections of "Location","Month","Model", then you can use this formula, but it will calculate Totalcount for each row.
I would suggest you to give some expected results, then I can work directly for the purpose.
Best Regards
Maggie
- v-juanli-msft8 years agoCommunity Support
Hi admiralman
put this in a chart and graph by month with a totla price per month...not by model
Does this chart meet your goals?
When I select multiple months this does not seem to work.
What do you want to show when you select multiple months?
Best Regards
Maggie