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

Problem with Wieghted Average

Dear all,

 

I am facing a problem regarding the weighted average formula.

 

Here is what I need to do: calculate an average of the L/C column weighted by the volume:

Group 1L/CVolume TO
Areva2,69%1111
Areva3,35%1205
Areva3,36%965
Areva3,29%888
Areva0,00%33
Areva0,00%21
Areva0,00%40

 

I use the formula "Weighted average per category" in "New Quick Mesure" and I put L/C in Base Value, Volumes in Weight and Group1 in Category but it doesn't work. The final average is not weighted. I have 1,81% as a result but, I should have 3,09%.

 

Do you know where does it come from?

Is there any other way to do it? (Be aware that the Excel used behind PBI is full of clients and dates, not only Areva).

 

Thanks for your help!!!

Rémy

1 ACCEPTED SOLUTION
v-yuta-msft
Community Support
Community Support

@remychag ,

 

You can create a measure using dax below:

Average = CALCULATE(AVERAGE('Table'[L/C]), FILTER('Table', 'Table'[L/C] <> 0))

Capture.PNG 

 

Community Support Team _ Jimmy Tao

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

2 REPLIES 2
amaleranda
Post Patron
Post Patron

Hi, 

 

Not sure what you want.

 

I have created weighted average based on the data you have provided. 

 

used below three measures

---------Measure 1-----------

TotalVolumeTO =
CALCULATE(
SUM('Table'[Volume TO]),
ALL('Table')
)
 

 

---------Measure 2-----------

Weight =
DIVIDE(
CALCULATE(
SUM('Table'[Volume TO])),
[TotalVolumeTO]
)
 

 

---------Measure 3-----------

WeightedAverage =
CALCULATE(SUM('Table'[L/C]) * [Weight])
 
 Capture.PNG

 

v-yuta-msft
Community Support
Community Support

@remychag ,

 

You can create a measure using dax below:

Average = CALCULATE(AVERAGE('Table'[L/C]), FILTER('Table', 'Table'[L/C] <> 0))

Capture.PNG 

 

Community Support Team _ Jimmy Tao

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.