Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
6 years ago
Solved

Weighted average in dax

Hi all, I need a formula to determined a weighted average as follows:

VolumeYield
152,549,311.483.00%
122,854,908.94.50%
35,234,814.974.50%
VolumeSumProduct
310,639,035.3511,690,516.92

In excel is simple, I just use a Sumproduct formula between both columns and the divided it between the total sum of the Volume, but I need to do the exact same thing with DAX.

=11,690,516.92/310,639,035.35 = 3.76%

 

Thanks a lot.

  • @bsolano

    Use Measure below:

    W Avg = 
    DIVIDE(
        SUMX(
            'Table',
            'Table'[Volume] * 'Table'[Yield]
        ),
        SUM('Table'[Volume])
    )

    Fowmy_0-1598301391673.png

    ________________________

    Did I answer your question? Mark this post as a solution, this will help others!.

    Click the Thumbs-Up icon if you like this answer 🙂

    Youtube Linkedin

2 Replies

  • @bsolano

    Use Measure below:

    W Avg = 
    DIVIDE(
        SUMX(
            'Table',
            'Table'[Volume] * 'Table'[Yield]
        ),
        SUM('Table'[Volume])
    )

    Fowmy_0-1598301391673.png

    ________________________

    Did I answer your question? Mark this post as a solution, this will help others!.

    Click the Thumbs-Up icon if you like this answer 🙂

    Youtube Linkedin

  • Anonymous , Try like

    divide(sumx(Table,Table[Volume]*Table[Yield]),sum(Table[Volume))

     

    In case you need % , mark column as % from measure tools