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
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
- fullcount4 years agoFrequent Visitor
Thanks, jdbuchanan71 . I wasn't able to completely reproduce the [Placements] value with the CALCULATETABLE version. Here are the results of the two measures on the same chart:
I have triple-checked the dates involved, so I'm thinking there's just a difference on what values the two measures reach. Think it's worth me switching to a Column?
Thanks!