The ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM.
Get registeredCompete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.
I want to create a measure to calculate Sum of Average (Weighted Instock in the image).
In the attached image - on Week 201949:
Weights (a measure) = Current Sales (for each Country Name) / Total Sales (all countries' Current Sales on 201949)
Total for Weights equals sum of all Weights (100%)
Avg Instock% is a column
Total for Avg Instock% equals average of all Avg Instock%
Weighted Instock = Weights * Avg Instock
Total for Weighted Instock at bottom still shows 94.7%, which is not correct, since I want to have sum of all Weighted Instock%.
Could any one advice how to create a measure to perform this function (sum of average)?
Thanks a lot,
Henry
Solved! Go to Solution.
@Henley678 , Create a measure like this and use
sumx(summarize(Table, Table[Week], Table[Country Name], "_1",[Weighted Instock]),[_1])
@amitchandak , thanks for the solution.
To follow up: what function does [_1] in the equation stand for?
It a label for the expression.
Proud to be a Super User!
Awesome Keyboard Shortcusts in Power BI, thumbs up if you like the article
My Community Blog Articles (check them out!)
My Blog - Power M code to automatically detect column types -
How to create test data using DAX!
@Henley678 , Create a measure like this and use
sumx(summarize(Table, Table[Week], Table[Country Name], "_1",[Weighted Instock]),[_1])
User | Count |
---|---|
28 | |
10 | |
8 | |
6 | |
5 |
User | Count |
---|---|
33 | |
13 | |
12 | |
9 | |
7 |