Forum Discussion
fullcount
4 years agoFrequent Visitor
Optimizing an Average measure
Hello, I have created a measure that averages weekly item placements over the previous six weeks. (Because the same item may be placed in the same store each week, I need to capture this at the ...
- 4 years ago
Context transition might be jamming you up on the [Placements] measure. In my testing, this returns the same results and is almost 3x faster.
Placements = COUNTROWS( CALCULATETABLE( VALUES(Sales[Item Name + Store Name]), Sales[Units Sold] > 0 ) )This is your measure.
This is mine
jdbuchanan71
4 years agoSuper User
Can you give us the calculation for the [Placements] measure? It's possible that this would give you the same result depending on what that measure is calculating.
Six WK Avg Weekly Placements =
DIVIDE (
CALCULATE (
[Placements],
DATESINPERIOD ( Calendar_Lookup[Date], MAX ( Sales[Date] ), -42, DAY )
),
6
)