Forum Discussion
ysherriff
Resolver II
4 years agoDateadd function not working
Hi all, I am trying to do a simple calculation to get the previous year utilizing dateadd. In Image 1, when I use previous year, the output is correct. When I tried to use Dateadd, the output sho...
- 4 years ago
PREVIOUSYEAR returns the values covering all dates in the previous year, while DATEADD as you have it returns the values for the same date in the previous year.
Are there any values for the previous year's dates where it is now showing blank?Also, does the date table contain continuous dates covering the whole range of dates in the model?
PaulDBrown
Community Champion
4 years agoDATEADD should work fine.
ysherriff
Resolver II
4 years agoI will try to do a workaround since my model doesn't fit DateAdd requirements.
Thanks
- PaulDBrown4 years ago
Community Champion
If your model contains a date table with continuous dates covering the range of dates in the model, the date table date field is linked to the date field in your fact model in a one-to-many single direction relationship and you use the date table field in your visuals, DATEADD should work ok.