Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

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.

Reply
Digger99
Regular Visitor

Adding Number of Months to a Date

Hi,

 

I am trying to add two different numbers to a date within my table using DAX. The date is when the product needs to be purchased 'First Order', i then want to add the Lead Time to this date 'LT' and then an additional 2 months to allow enough time for it to be shown in my account. The table looks like this:

 

First OrderLT (Months)

06/03/2023

10
09/03/20233
14/03/20235

 

Expected result would be - 06/03/2023 + 10 (LT) + 2 (Additional Months) = 06/03/2024

 

Any help will be greatly appreciated!!

 

Thanks.

1 ACCEPTED SOLUTION
FreemanZ
Super User
Super User

hi @Digger99 

try to add a calculated column like:

Column =EDATE([First Order], [LT]+2)

View solution in original post

7 REPLIES 7
shreyamukkawar
Resolver II
Resolver II

Hi,

new_clm = EDATE('Table'[First Order],'Table'[LT (Months)]+2)
 
shreyamukkawar_0-1678100689919.png

Best Regards,
Shreya

Appreciate with a Kudos!! (Click the Thumbs Up Button)
Did I answer your question? Mark my post as a solution!

Hi Shreya,

 

Thanks for the response. I have tried EDATE but seem to get an error message "An argument of function 'EDATE' has the wrong data type or the result is too large or too small". 

Do you have anything else i could try?

FreemanZ
Super User
Super User

hi @Digger99 

try to add a calculated column like:

Column =EDATE([First Order], [LT]+2)

Thanks for the reply.

I have tried EDATE but i get the error message "An argument of function 'EDATE' has the wrong data type or the result is too large or too small". 

hi @Digger99 

please check if the data type of [First Order] is date/time, [LT] is whole number.

Can confirm that [First Order] is Date/Time - it was just date before but have changed to Date/Time. [LT] is a whole number.

@FreemanZ I have just tried it another table and its been accepted. I think because i was using the EDATE function in a calculated table it was throwing an error up.

 

Thank you very much for the help, i will accept your comment as the solution!

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.

Top Solution Authors