Forum Discussion
Time intelligence issues with SAMEPERIODLASTYEAR and DATEADD functions
If you had a real date table in your model, then applying DATESYTD to it would yield the full last year that exists in the table, in your case it would be the whole year 2020. I've checked it. This is because if there is no filter on the table, the last day visible would be the very last day and DATESYTD would then use this very last day and returned all the dates in the year up to this very last day.
Best
Darek
This is not my understanding of the DATESYTD function. The DATESYTD function should return all dates starting on the 1st of January of the current year till today irrespective of which is the last date in the Date Dimension.
- Anonymous7 years agoNot applicable
Sorry but your understanding is wrong then. Please go to
and read. You have to know that the function operates on filters. It has no knowledge about what the current day is today. If it did, it would be totally useless in calculations.
Best
Darek
- Anonymous7 years agoNot applicable
I am still confused. What I read is "Returns a set of dates in the year up to current date" current date means that it knows what the curent day is.
If not then could you please give me a few examples of what DATESYTD would return given a specific inputs? Thank you for your time.
- Anonymous7 years agoNot applicable
Current Date always means the current date as visible in the current filter context. As I said, if that was always the current real date, the function would be of no use.
If you select Sep-1999 in your date table, then DATESYTD( Dates[Date] ) will return dates from 1999-01-01 up to and including the last day of September 1999.
Best
Darek