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

To celebrate FabCon Vienna, we are offering 50% off select exams. Ends October 3rd. Request your discount now.

Reply
SrinivasK
New Member

Calculate weighted average based on another field

I have product wise volume and certain budget allocated on it but need to find prorpotion of this budget by calculating share of volume in total volume.

I tried few variations of this - using Allselected or All because there were few filters working on this visual matrix table. But unable to get the result shown in weighted average column below. Can any expert help ?

 

Weighted Avg = 

var totalvol = calculate(sum(table[Vol]),All (table)),

Return

Sumx(

       All (table),

       Divide ((table[Vol]), totalvol) * (table[Budget]))

 

 

Ex: 

ProductVolBudgetWeighted Avg (Result) 
A2005012.5 ((200/800)*50)
B2005012.5
C2004812
D2004812
Total800  
2 ACCEPTED SOLUTIONS
ahadkarimi
Solution Specialist
Solution Specialist

Hi @SrinivasK , try this measure below, and if you encounter any issues, let me know.

Weighted Avg = 
VAR TotalVol = CALCULATE(SUM(Table[Vol]), ALL(Table))
RETURN
SUMX(
    Table,
    DIVIDE(Table[Vol], TotalVol) * Table[Budget]
)

Did I answer your question? If so, please mark my post as the solution! ✔️
Your Kudos are much appreciated! Proud to be a Solution Supplier!

View solution in original post

SrinivasK
New Member

Thanks @ahadkarimi for your answer. I changed All to Allselected on Total var and it worked. I guess since there are filters applied, on the matrix, the allselected worked. 

 

View solution in original post

2 REPLIES 2
SrinivasK
New Member

Thanks @ahadkarimi for your answer. I changed All to Allselected on Total var and it worked. I guess since there are filters applied, on the matrix, the allselected worked. 

 

ahadkarimi
Solution Specialist
Solution Specialist

Hi @SrinivasK , try this measure below, and if you encounter any issues, let me know.

Weighted Avg = 
VAR TotalVol = CALCULATE(SUM(Table[Vol]), ALL(Table))
RETURN
SUMX(
    Table,
    DIVIDE(Table[Vol], TotalVol) * Table[Budget]
)

Did I answer your question? If so, please mark my post as the solution! ✔️
Your Kudos are much appreciated! Proud to be a Solution Supplier!

Helpful resources

Announcements
September Power BI Update Carousel

Power BI Monthly Update - September 2025

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

August 2025 community update carousel

Fabric Community Update - August 2025

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