Forum Discussion
cparker4486
11 months agoHelper III
Finding Average Unit Price Across Invoices
Very new to Measures and struggling to wrap my head around this. It's probably going to be quite simple once I see the answer. Invoice Product Quantiy Unit Price INV001 Apple 3 $5.00 ...
- 11 months ago
Avg Unit Price Per Invoice =
AVERAGEX(
VALUES('Invoice Lines (2) Dim'[Invoice]),
CALCULATE(AVERAGE('Invoice Lines (2) Dim'[Unit Price]))
)
This gives you the average unit price per invoice, not weighted by quantity—just like your example. Clean, accurate, and context-aware.
Ashish_Mathur
11 months agoSuper User
Hi,
Wouldn't you want to calculate the weighted average price instead?
cparker4486
11 months agoHelper III
That would also be good to know. Please provide the formula if you can. Thank you.
- Ashish_Mathur11 months agoSuper User
Try this measure
Avg. Unit Price = SUMX('Invoice Lines (2) Dim', 'Invoice Lines (2) Dim'[Unit Price]*'Invoice Lines (2) Dim'[Quantity]) /sum('Invoice Lines (2) Dim'[Quantity])