Forum Discussion
Rygar
Helper II
4 years agoSubstitute TotalYTD with Calculate? (best Practice)
Hi Community,
I have this two expressions:
CALCULATE(
[Sum Quantity],
DATEADD(dDate[Date],
-1,
MONTH
)
TOTALYTD(
[Sum Quantity],
dDate[Date],
DATEADD(dDate[Date],-1,MONTH)
)
Both bring the same result, as expected. Which one is the better solution?
Thanks & regards
Michael
Hey,
If you would like to know the quantity of the previous month I would go for the CALCULATE version. That variant is more logical and natural. Moreover, the YTD variant does not work for January, because YTD is always based on the current year (the previous month, December of the previous year, is not in scope).
2 Replies
- Barthel
Solution Sage
Hey,
If you would like to know the quantity of the previous month I would go for the CALCULATE version. That variant is more logical and natural. Moreover, the YTD variant does not work for January, because YTD is always based on the current year (the previous month, December of the previous year, is not in scope).
- Rygar
Helper II
Hey Barthel, thank you very much for your advice!