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

The Power BI DataViz World Championships are on! With four chances to enter, you could win a spot in the LIVE Grand Finale in Las Vegas. Show off your skills.

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
Feb2025 Sticker Challenge

Join our Community Sticker Challenge 2025

If you love stickers, then you will definitely want to check out our Community Sticker Challenge!

Jan NL Carousel

Fabric Community Update - January 2025

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