Forum Discussion

Tob_P's avatar
Tob_P
Helper V
3 years ago
Solved

DATEADD issue

Hi,

 

See below...

 

 

Dax appears to work correctly for calculated column only for dates when the expiry date is in the past.

 

Pay attention to columns Validity Formatted, Date of Issue and New Expires.

 

Cannot see for the life of me why this would not calculate an expiry date for anything that expires on or after today.

 

Can anyone advise?

3 Replies

  • Apologies some_bih 

     

    Thank you for the reply - I sort of struggle to understand 'The result table includes only dates that exist in the date column' - does that mean it can only calculate the output of 01/05/2023, 1, YEAR if the date of 01/06/2024 is in the Date column? If that's the case, firstly why would you have a future date in there if not required and secondly, it sort of defeats the purpose of the calculation. Or does it mean that the date of 01/05/2023 has to exist, which it does, for the function to work?

     

    Either way, if this function is not going to work for me, is anyone aware of an alternative function that takes a date, and will output future dates based on intervals & years.

     

    some_bih - I will mark your reply as a solution but looking to see if I can get any additional advice to point me in the direction.

    • some_bih's avatar
      some_bih
      Community Champion

      Hi Tob_P I am glad if I can assist you in Power BI experience, no matter kudos or solutions.

      Concerning your "issue" with DATEADD, if you simple need to obtain some new / future date based on column which you already have in your data when Power Query, possible alternative solution with new column with function Date.AddYears, like Date.AddYears([<your column name], your reference for adding)

      https://learn.microsoft.com/en-us/powerquery-m/date-addyears