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

Microsoft is giving away 50,000 FREE Microsoft Certification exam vouchers. Get Fabric certified for FREE! Learn more

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
PBIApril_Carousel

Power BI Monthly Update - April 2025

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

Notebook Gallery Carousel1

NEW! Community Notebooks Gallery

Explore and share Fabric Notebooks to boost Power BI insights in the new community notebooks gallery.

April2025 Carousel

Fabric Community Update - April 2025

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

Top Solution Authors