Skip to main content
cancel
Showing results forย 
Search instead forย 
Did you mean:ย 

Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.

Reply
Henley678
Frequent Visitor

Calculate Sum of Average

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

 

Henley678_0-1613516250760.png

 

 

1 ACCEPTED SOLUTION
amitchandak
Super User
Super User

@Henley678 , Create a measure like this and use

sumx(summarize(Table, Table[Week], Table[Country Name], "_1",[Weighted Instock]),[_1])

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

View solution in original post

4 REPLIES 4
amitchandak
Super User
Super User

@Henley678 , Create a measure like this and use

sumx(summarize(Table, Table[Week], Table[Country Name], "_1",[Weighted Instock]),[_1])

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube
Henley678
Frequent Visitor

@amitchandak , thanks for the solution.

 

To follow up: what function does [_1] in the equation stand for?

Henley678
Frequent Visitor

@stevedep , make sense. Thanks a lot.

Helpful resources

Announcements
November Fabric Update Carousel

Fabric Monthly Update - November 2025

Check out the November 2025 Fabric update to learn about new features.

Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Users online (25)