Forum Discussion
VFXPro
Advocate II
7 years agoSimple calculated Date field using IF is not working...
I'm simply trying to get a date value calculated using a column depending on a condition, but it doesnt' work, what I am missing? Calculated Due Date: If the contract is digital then use the (e...
- 7 years ago
Hi VFXPro
If you are using the Power Query Editor, then you can add a custom column using this formula. For something like this it doesn't really matter if you create it in M (Power Query) or DAX (Power BI Desktop)
if [Format] = "Digital" then Date.AddDays([ReceivedDate],7) else Date.AddDays([EndDate],7)
HotChilli
Community Champion
7 years agoDATEADD is an unusual function. If the date you end up with doesn't exist in the table already, it shows as blank.
I've never looked in detail at this but I presume it uses the in-built pseudo dates (hidden) table, and if it can't find it, it shows blank.
2 solutions: 1 - just add (+) the number (7 in your case) to the date
or 2 - use DATEADD but develop your own 'dates' table in the model