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

The Power BI Data Visualization World Championships is back! It's time to submit your entry. Live now!

Reply
Anonymous
Not applicable

Add a column of date to a column of numbers in a new column

Hello everyone , 

I want to add a column of  dates to a column of numbers in a new column . Thanks ! 

2 ACCEPTED SOLUTIONS

add custom column with this formula
Date.AddDays([column1],[column2])

 

View solution in original post

PhilipTreacy
Super User
Super User

Hi @Anonymous 

 

Download example PBIX file

 

In Power Query add a Custom Column with this code

 

 

= Date.AddDays([Date] , [Number])

 

 

 

Here's the full example query

 

 

let
    Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WMtU30zcyMDJW0lEyVYrViVYystA3homYKMXGAgA=", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [Date = _t, Number = _t]),
    #"Changed Type" = Table.TransformColumnTypes(Source,{{"Date", type date}, {"Number", Int64.Type}}),
    #"Added Custom" = Table.AddColumn(#"Changed Type", "New Date", each Date.AddDays([Date] , [Number]))
in
    #"Added Custom"

 

 

 

adddays.png

 

Regards

 

Phil



Did I answer your question? Then please mark my post as the solution.
If I helped you, click on the Thumbs Up to give Kudos.


Blog :: YouTube Channel :: Connect on Linkedin


Proud to be a Super User!


View solution in original post

9 REPLIES 9
PhilipTreacy
Super User
Super User

Hi @Anonymous 

 

Download example PBIX file

 

In Power Query add a Custom Column with this code

 

 

= Date.AddDays([Date] , [Number])

 

 

 

Here's the full example query

 

 

let
    Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WMtU30zcyMDJW0lEyVYrViVYystA3homYKMXGAgA=", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [Date = _t, Number = _t]),
    #"Changed Type" = Table.TransformColumnTypes(Source,{{"Date", type date}, {"Number", Int64.Type}}),
    #"Added Custom" = Table.AddColumn(#"Changed Type", "New Date", each Date.AddDays([Date] , [Number]))
in
    #"Added Custom"

 

 

 

adddays.png

 

Regards

 

Phil



Did I answer your question? Then please mark my post as the solution.
If I helped you, click on the Thumbs Up to give Kudos.


Blog :: YouTube Channel :: Connect on Linkedin


Proud to be a Super User!


Anonymous
Not applicable

Hi theracy , I have a date column ( dd/mm/yyyy) and i have a numbers columns , i want a new column where it represents the sum of the two columns . For example , i have in date table ( 05/06/2023) and in the numbers column 5 then the result in the column that i want will be 10/06/2023 . if the date is 28/03/2023 and in number column we have 4 then the result will be 01/04/2023 . Thanks 

add custom column with this formula
Date.AddDays([column1],[column2])

 

Anonymous
Not applicable

Hey @aditya0125 , 

You can see in the picture below the result that i wanted ! Thanks cap.png

see this result bro.Screenshot (44).png

Anonymous
Not applicable

@aditya0125 It add on the month not the days , Thanks !

Bro its MM/DD/YYYY. so it add date not month.

aditya0125
Resolver I
Resolver I

not getting it bro. be more specified.

 

PhilipTreacy
Super User
Super User

Hi @Anonymous 

 

Please be a lot more specific about what it is you are trying to do, provide some sampe data, and give an example of the desired result.

 

Regards

 

Phil



Did I answer your question? Then please mark my post as the solution.
If I helped you, click on the Thumbs Up to give Kudos.


Blog :: YouTube Channel :: Connect on Linkedin


Proud to be a Super User!


Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! It's time to submit your entry.

January Power BI Update Carousel

Power BI Monthly Update - January 2026

Check out the January 2026 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.