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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
st-mb
Frequent Visitor

Weighted Average from Measures

Hello,

 

I'm trying to calculate the weighted average of a contribution score with some existing measures, but I just can't seem to get this one right.

 

There's three work orders tables (site a & site b tables are the same layout, site c's layout is different) and an employee table. They are linked together using the employee's UserID. I currently use the following measures to track the work completed (each row is considered a unique work order):

 

Site A & B Work Completed = COUNTA(UNION('Site A Work','Site B Work'),[UserID]

Site C Work Completed = COUNTA('Site C Work'),[UserID]

Total Work Completed = [Site A & B Work Completed] + [Site C Work Completed]

 

I currently use the following measures to get an individual's contribution percentage and an unweighted team average:

 

Contribution Percentage = DIVIDE([Total Work Completed],CALCULATE([Total Work Completed],ALL(Employee[UserID])))

Average Contribution Percentage (Unweighted) = DIVIDE([Contribution Percentage],DINSTINCTCOUNT(Employee[UserID]),0)

 

2018-10-25_15-24-45.png

 

 

 

What I would like to achieve is a weighted average of the contribution percentage to use in a card visual, as seen in this Excel formula:

 

2018-10-25_15-20-35.png

 

I'm hoping there's an easy way to go about this without having to merge/modify the existing tables.

 

Thanks for your time!

1 ACCEPTED SOLUTION
v-cherch-msft
Employee
Employee

Hi @st-mb

 

You may refer to below measure. If it is not your case, please share some data sample.

Measure =
SUMX (
SUMMARIZE ( Table, Table[Name] ),
[Total Work Completed] * [Contribution Percentage]
)
/ [Total Work Completed]

Regards,

Cherie

Community Support Team _ Cherie Chen
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

1 REPLY 1
v-cherch-msft
Employee
Employee

Hi @st-mb

 

You may refer to below measure. If it is not your case, please share some data sample.

Measure =
SUMX (
SUMMARIZE ( Table, Table[Name] ),
[Total Work Completed] * [Contribution Percentage]
)
/ [Total Work Completed]

Regards,

Cherie

Community Support Team _ Cherie Chen
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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