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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

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
RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.

MayPowerBICarousel

Power BI Monthly Update - May 2024

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

LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.