Forum Discussion
Time intelligence issues with SAMEPERIODLASTYEAR and DATEADD functions
Dear Darek,
thank you for your reply. The Table 1 ends of 9th of July 2019 because of the DATESYTD function. So Actualy Table shows what I am expecting to see. I do not understand yous statement that "your Date dimension table 'Order Date' is not a real Date Table marked as such in the model".
The 'Order Date' table has a column [Date] of type Date with has dates from the begining of 2005 till the end of 2020. Could you elaborate further? Thanks.
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
- Anonymous7 years agoNot applicable
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.