Forum Discussion
Writing out expression gives different result than inserting the measure that is exactly the same?
Hey guys i'm learning dax. I wrote this measure on training data=
hi Anonymous
Since Total Quantity Sold = SUM(Sales[Quantity])
In the Measure [Average Quantity Sold per Day], It nested a measure [Total Quantity Sold].
Average Quantity Sold per Day = AVERAGEX(VALUES(Dates[Date]);[Total Quantity Sold]) ,
So it essentially looks like this formula
Average Quantity Sold per Day=AVERAGEX(VALUES('Date'[Date]); CALCULATE(SUM(Sales[Quantity])) )
not this formula Average Quantity Sold per Day = AVERAGEX(VALUES(Dates[Date]);SUM(Sales[Quantity]))
Please refer to CALCULATE Function in dax
https://docs.microsoft.com/en-us/dax/calculate-function-dax
Regards,
Lin
1 Reply
- v-lili6-msft
Community Support
hi Anonymous
Since Total Quantity Sold = SUM(Sales[Quantity])
In the Measure [Average Quantity Sold per Day], It nested a measure [Total Quantity Sold].
Average Quantity Sold per Day = AVERAGEX(VALUES(Dates[Date]);[Total Quantity Sold]) ,
So it essentially looks like this formula
Average Quantity Sold per Day=AVERAGEX(VALUES('Date'[Date]); CALCULATE(SUM(Sales[Quantity])) )
not this formula Average Quantity Sold per Day = AVERAGEX(VALUES(Dates[Date]);SUM(Sales[Quantity]))
Please refer to CALCULATE Function in dax
https://docs.microsoft.com/en-us/dax/calculate-function-dax
Regards,
Lin