Forum Discussion
shaykoooo
Helper I
8 years agoDifferenr results then expected
Hi,
In sheet "???", I have two measres, Average Quantity Sold per Day = AVERAGEX(VALUES(Dates[Date]),[Total Quantity Sold]) and Average Quantity Sold per Day 2 = AVERAGEX(VALUES(Dates[Date]),SUM(Sales[Quantity])) not returning the same result as I expect. What is the reason for that?
The measue [Total Quantity Sold] is bulit from the expression SUM(Sales[Quantity]) and that's why I assumed it would return the same results...
TY
You should wrap the sum inside calculate to transform the ROW context into FILTER CONTEXT
Average Quantity Sold per Day 2 = AVERAGEX ( VALUES ( Dates[Date] ), CALCULATE ( SUM ( Sales[Quantity] ) ) )
2 Replies
- Zubair_Muhammad
Community Champion
You should wrap the sum inside calculate to transform the ROW context into FILTER CONTEXT
Average Quantity Sold per Day 2 = AVERAGEX ( VALUES ( Dates[Date] ), CALCULATE ( SUM ( Sales[Quantity] ) ) )
- shaykoooo
Helper I
And in the first measure there is no need to wrap the measure [Total Quantity Sold] there is no need to with CALCULATE since measures have an Implicit CALCULATE?