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

Compete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.

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
Henley678
Frequent Visitor

@stevedep , make sense. Thanks a lot.

Henley678
Frequent Visitor

@amitchandak , thanks for the solution.

 

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

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

Helpful resources

Announcements
July 2025 community update carousel

Fabric Community Update - July 2025

Find out what's new and trending in the Fabric community.

July PBI25 Carousel

Power BI Monthly Update - July 2025

Check out the July 2025 Power BI update to learn about new features.