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

Be one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now

Reply
MichaiahGartner
Frequent Visitor

DAX Formula to add 30 days to a time/date column

I wanted to create another column which adds 30 days to each date listed in another column. I tried using the formula: ColumnName2 = DATEADD(Table[ColumnName1],+30,DAY) but it doesn't seem to work.

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi

 

Dateadd generates proper date result only when the source column date is continoues and the expected date sould be there in the source column. In your case the Table[Columnname1] may not meet the above condition. Either you can cretae a calendar table and use that date column , if you want to use dateadd. Else, as suggested above use New column = Tavble[ColName1]+30.

 

Thanks
Raj

 

View solution in original post

4 REPLIES 4
Anonymous
Not applicable

_donev  - the above solution "ColumnName2" works if in a BI table - but if in query mode - the solution works as  example:    ColumnName = Date.AddDays([Invoice Date],30)   (My example would be like an invoice date + 30 days for due date)

Joorge_C
Resolver II
Resolver II

I think you are going to need t columns, 1 with date by day (1/1/2018 etc...) and anotherone with Days by Month (31Days etc) ... then your formula would be something like Calculate(Sum(DaysInMonth)),DateADD(YourDateColumn)+30))

Anonymous
Not applicable

Hi

 

Dateadd generates proper date result only when the source column date is continoues and the expected date sould be there in the source column. In your case the Table[Columnname1] may not meet the above condition. Either you can cretae a calendar table and use that date column , if you want to use dateadd. Else, as suggested above use New column = Tavble[ColName1]+30.

 

Thanks
Raj

 

_donev
Regular Visitor

You can try this:

ColumnName2 = Table[ColumnName1] + 30

Helpful resources

Announcements
ArunFabCon

Microsoft Fabric Community Conference 2025

Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.