Forum Discussion

remychag's avatar
remychag
Frequent Visitor
6 years ago
Solved

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

  • remychag ,

     

    You can create a measure using dax below:

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

     

     

    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.

2 Replies

  • v-yuta-msft's avatar
    v-yuta-msft
    Community Support

    remychag ,

     

    You can create a measure using dax below:

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

     

     

    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.

  • 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])