Forum Discussion
Dateadd not working as expected
Using dateadd but it's not returning the expected value. Trying to get the sum of qty sold from the same period last year, however, this calculation is returning value on the saem period of the year... Could anyone help here? Thanks!
5 Replies
- parry2k
Super User
As a best practice, add a date dimension in your model and use it for time intelligence calculations. Once the date dimension is added, mark it as a date table on table tools. Check the related videos on my YT channel
Add Date Dimension
Importance of Date Dimension
Time Intelligence PlaylistAnd now in your measure use date from the date dimension and everything should work.
- Pady
Helper II
Please create a Date table and an YearMonth column in the Date table and create a relationship with the table containing quantity and use the Measure shown in the screenshot below:
- efeng2023Regular Visitor
I created a table (from 1/1/2021 to 12/31/2024) as instructed, and created the relationship between two tables, however, when I put them into one table, it gave me this result.
- efeng2023Regular Visitor
1. The corss relationship between two tables are set by the system when I connected them
2. The Dates table is marked as a date table