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
pbi_wannabe_exp
Regular Visitor

Weighted AVG Calculation

Hey all,

 

I have the following data table with many names but I only copied the table with 2 names now: setup.py and path.xyz. (date, name, loc_i, loc_d columns are originally in the table, and AGE, Weight, Weighted AVG are calculated.

 

datenameloc_iloc_dAGEWeightWeighted AVG 
24/01/22 13:20:06setup.py410129.44334271.664375 
27/01/22 11:31:23setup.py11126.521126.5198727 
28/01/22 08:54:20setup.py11125.631125.6289352 
09/03/22 08:22:06setup.py2285.652171.3026389 
05/04/22 07:57:04setup.py1058.67158.6687037 
05/04/22 07:54:23setup.py1058.67158.67056713 
27/01/22 09:45:36setup.py22126.592253.1866667 
28/01/22 08:46:19setup.py22125.632251.2690046123.6491
24/01/22 13:20:06path.xyz350129.44263365.55375 
27/01/22 11:31:23path.xyz21126.522253.0397454 
28/01/22 08:54:20path.xyz10125.631125.6289352 
09/03/22 08:22:06path.xyz1085.65185.65131944 
05/04/22 07:57:04path.xyz1058.67158.6687037 
05/04/22 07:54:23path.xyz1158.67158.67056713 
27/01/22 09:45:36path.xyz11126.591126.5933333 
28/01/22 08:46:19path.xyz11125.631125.6345023 
24/01/22 13:30:06path.xyz11129.441129.4374306 
28/01/22 11:31:23path.xyz22125.522251.0397454 
28/01/22 08:55:20path.xyz22125.632251.2564815123.8763

 

Here you can see the formulas behind the calculated columns:

 

pbi.JPG

I would like to create the final calculation in PBI somehow (please note that my data table consists of more than 2 names - thousands).

Many thanks in advance!

1 ACCEPTED SOLUTION
lbendlin
Super User
Super User

Wavg = divide(sumx('Table','Table'[AGE]*'Table'[Weight]),sumx('Table','Table'[Weight]))

 

lbendlin_0-1654274583899.png

see attached

View solution in original post

3 REPLIES 3
lbendlin
Super User
Super User

Wavg = divide(sumx('Table','Table'[AGE]*'Table'[Weight]),sumx('Table','Table'[Weight]))

 

lbendlin_0-1654274583899.png

see attached

Many thanks for your reply!! One thing I dont know is that how I can add weight calculation to the pbi. Only date, name, loc_i, loc_d is in the model. I understand how to add a calculated column measure in case of AGE and Weighted AVG, but what about Weight?

see attached

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.