Forum Discussion
NBOnecall
Helper V
6 years agoMeasure total is not correct
Hi, Need some help and yes I know there are a dozen of threads for this same exact issue, but whatever I am doing in relation to those answers isn't working for me. My measure is the followin...
NBOnecall
Helper V
6 years agoThe avgSalesPerUnit matches my Average of Sales/unit columns.
SalesRegister and InventorySnapshot is linked via internal ID of NetsuiteItem table.
masonlee01
6 years agoRegular Visitor
Without having the data, hard to play with. Maybe this will work?
lostSales = SUMX(SUMMARIZE('ns SalesRegister', 'ns SalesRegister'[InternalId], "myAvg", AVERAGE('ns SalesRegister'[Sales/Unit])), [myAvg] * 'ns vwInventorySnapshot'[OutofStock])
- NBOnecall6 years ago
Helper V
I'm getting an error with the ns vwInventorySnapshot'[OutofStock] piece. Looks like it is not an available option for the SUMX formula.
- masonlee016 years agoRegular Visitor
Alright, i got it with some dummy data.
invID itemID OOS Price
a a12 2 5 b a12 4 6 c a13 6 7 d a13 1 8 e a14 0 9 f a14 4 10 g a15 2 11 h a16 4 12 avgPrice=AVERAGEX(data, data[Price]) blendedPrice=CALCULATE([avgPrice], ALLEXCEPT(data, data[itemID])) totalOOS=SUMX(data, data[OOS]) lostSales=[totalOOS]*[blendedPrice]- masonlee016 years agoRegular Visitor
You'll need to adjust to your tables & columns, but I think it's working