Forum Discussion
Calculated Column not returning all correct values
Hi,
I created a calculated column that is taking the data from the "Wholesale Ship Date" column and adding 5 days to it:
I figured out the solution. The value that the measure returns using the DATEADD function must exist in the same column (in this case Wholesale Ship Date) which isn't always true. I just added +5 to my Wholesale ship date column and it solved my issue.
3 Replies
- vicky_Super User
Hmm i would check if your 'Wholesale | Retail' table actually has a value that is 5 days before. I.e is there actually a 5/26/2022 in the dataset? how about 6/25/22? If not, then that would be why your formula is returning blanks - it can't create a date that doesn't exist in the dataset.
To fix it, you can create a date table (which contains every single date) and use that in your calculations instead.- PBandIFrequent Visitor
The column should be adding 5 days to the "Wholesale Ship Date" column so why would it need to look and see if there is a value 5 days before? If I'm understanding correctly I just thought there would need to be a date in that column and then the measure would compute 5 days after that date and put that value in the new calculated column. I also currently have a date table that is connected to my "Wholesale | Retail" table but when I create the measure in the date table I still recieve blanks. Here is a new sample using the same measure but created within the date table:
- PBandIFrequent Visitor
I figured out the solution. The value that the measure returns using the DATEADD function must exist in the same column (in this case Wholesale Ship Date) which isn't always true. I just added +5 to my Wholesale ship date column and it solved my issue.