DAX Weighted Average Price Measure

Averages the unit price weighted by quantity sold, instead of a simple unweighted average of prices.

FinanceIntermediateweighted averagepricesumproduct

DAX code

Weighted Average Price =
DIVIDE(
    SUMX('Sales', 'Sales'[UnitPrice] * 'Sales'[Quantity]),
    SUM('Sales'[Quantity])
)

Notes

This is mathematically the same as Average Selling Price when price and quantity come from the same rows - use whichever name fits your report.

Requirements

How to use this measure

  1. In Power BI Desktop, select the table that should hold the measure and choose New measure on the ribbon.
  2. Paste the code, then replace the placeholder table and column names with your own. The My table names fields above do this for you.
  3. Run it through the DAX Formatter if you want it laid out in your team's style.

Related DAX measures

More DAX resources

Browse all 175 measures in the Power BI DAX Measures Library, or search the library for something similar to Weighted Average Price.