Forum Discussion

S184019's avatar
S184019
Advocate III
8 years ago
Solved

Summarize Total By Weighted Average

How does one summarize by weighted average?  This seems like it should be a straightforward thing.  When I click on the calculated column I am working with my options are:

Weighted average isn't there.  Perhaps there is a way to change the word "Total"  at the foot of the table to "Weighted Average" and create a calc. if this isn't in the work at MS?   I am trying to avoid having to build a completely independent table and overlay it on the existing table.   If there is a work around while weighted average is added to the summarize options within desktop, then please read on. 

 

The values I am working with are: 

Measure = Numerator/Denominator

 

IDPersonNumeratorDenominatorMeasureMonth
1234Person A17210.80952417-Sep
5678Person B16180.88888917-Sep
91011Person C73770.94805217-Sep
121314Person D88117-Sep

 

 

The Dax is: 

Sep-17 = DIVIDE(
        calculate(
                sum('% New Sch 30'[New Within 30 Qty]),'% New Sch 30'[Month] = "Sep-17"),
        calculate(
                sum('% New Sch 30'[Arrived Completed Qty]),'% New Sch 30'[Month] = "Sep-17"))

Any help here is greatly appreciated!

 

Thanks in advance,

 

Mark

  • Hi S184019

    To get weighted average as you expected, try this formula

    measure2 =
    DIVIDE (
        CALCULATE (
            SUM ( Sheet11[Numerator] ),
            FILTER ( ALL ( Sheet11 ), [Month] = DATE ( 2018917 ) )
        ),
        CALCULATE (
            SUM ( Sheet11[Denominator] ),
            FILTER ( ALL ( Sheet11 ), [Month] = DATE ( 2018917 ) )
        )
    )

     

     

    Best Regards

    Maggie

2 Replies

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

    Hi S184019

    To get weighted average as you expected, try this formula

    measure2 =
    DIVIDE (
        CALCULATE (
            SUM ( Sheet11[Numerator] ),
            FILTER ( ALL ( Sheet11 ), [Month] = DATE ( 2018917 ) )
        ),
        CALCULATE (
            SUM ( Sheet11[Denominator] ),
            FILTER ( ALL ( Sheet11 ), [Month] = DATE ( 2018917 ) )
        )
    )

     

     

    Best Regards

    Maggie

  • S184019's avatar
    S184019
    Advocate III

    Forgot to mention Weighted Average = 114/124 = 0.9193548... 

    Average for the 4 groups (0.8095+0.8888+0.9481+1)/4  0.9116162...