Forum Discussion
stefanot
3 years agoFrequent Visitor
Averageif based con current line
Hallo, I've found similar questions to mine in the forum, but it looks like none of them is really what I'm looking for In PowerPivot/DAX I want to create a measure that represents an averageif o...
- 3 years ago
Hi stefanot ,
Please try:
AverageNumberofSALES = CALCULATE(AVERAGE('Table'[SALES]),ALLEXCEPT('Table','Table'[Product]))Final output:
Best Regards,
Jianbo Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
stefanot
3 years agoFrequent Visitor
a calculated column.
the objective later on is to create a measure that can calculate the difference between the sales of any selected line in the pivot and the fixed number (so not changing based on how you play with the pivot) of average sales of that specific product.
hope this clarifies, thanks for your message!
- daXtreme3 years agoSolution Sage
[SalesAverageIf] = // calc column var CurrentProd = T[Product] var Result = AVERAGEX( FILTER( T, T[Product] = CurrentProd ), T[Sales] ) return Result