Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.
Hi,
I created a custom column to add 14 days to a date (Document Date), but it is returning a blank value. If I change the number of days to 10 or under, it works perfectly. Is there a limitation to the number of days you can use with DATEADD? Or am I missing something?
Result with 14 days:
First Payment Due Date = DATEADD('Purchase Lines'[Document Date], 14, DAY)
Result with 10 days:
First Payment Due Date = DATEADD('Purchase Lines'[Document Date], 10, DAY)
Thanks!
Solved! Go to Solution.
Hi, @NatK ;
Because the date returned by dateadd is first the date in 'Purchase Lines' [Document Date], if the resulting date is not in this 'Purchase Lines' [Document Date] column, it returns empty. For example, 2022-11-22 +14day=2022-12-6; However, 2022-12-6 is not in your date column ... however 2022-11-22 +10day=2022-12-2 in your column, so it return value.
we could modify measure as follow:
Dateadd =
DATEADD('Table'[Date],10,DAY)
The final show:
Best Regards,
Community Support Team _ Yalan Wu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Thank you so much everyone! @v-yalanwu-msft your explanation makes sense. The Document Date column had a max date of 12/2/2022, explaining why I couldn't add more than 10 days. I couldn't open up your PBIX file, but thank you for your help. I ended up going with @djurecicK2 's solution and created another date table that related to Document Date. Then I ran DateAdd on the date field from the new date table. It works perfectly.
Thanks again!
NK
Hi, @NatK ;
Because the date returned by dateadd is first the date in 'Purchase Lines' [Document Date], if the resulting date is not in this 'Purchase Lines' [Document Date] column, it returns empty. For example, 2022-11-22 +14day=2022-12-6; However, 2022-12-6 is not in your date column ... however 2022-11-22 +10day=2022-12-2 in your column, so it return value.
we could modify measure as follow:
Dateadd =
DATEADD('Table'[Date],10,DAY)
The final show:
Best Regards,
Community Support Team _ Yalan Wu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi @NatK ,
You many want to consider adding a separate date table to your model.
https://blog.enterprisedna.co/tips-in-creating-power-bi-date-tables/
Hi @NatK,
Could you please try creating it as a measure instead of a calculated column. I've tried this in my test and it worked fine for me.
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
111 | |
100 | |
80 | |
64 | |
58 |
User | Count |
---|---|
148 | |
111 | |
93 | |
84 | |
66 |