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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
Anonymous
Not applicable

Transformation to Add Days

 

Guys, what is wrong with this syntax please? It doesn't generate error but it doesn't make the needed transformation either. What I need to do is to add 1 day over the dates (by transformation not by adding new column)

 

= Table.TransformColumns(#"Changed Type",{{"Hiring Effective Date", each _, Date.AddDays([Hiring Effective Date],1), type date}})

6 REPLIES 6
Anonymous
Not applicable

Thank you all, I got the reply from another community already by now, appreciate your help.

Anonymous
Not applicable

Hi @Anonymous ,

 

It doesn’t hurt to add a new column.

You can add a new column and then delete the original column, rename it to get the date column.

= Date.AddDays([Date],1)

16.png

18.png17.png

More details you can refer to Date.AddDays - PowerQuery M.

Also refer to my attachment.

 

 

 

 

Best Regards,

Stephen Tao

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

 

 

 

Best Regards,

Stephen Tao

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

jennratten
Super User
Super User

You were very close!  Here is the script you need.  When transforming columns, the function takes a list of transformations that includes the column name to be transformed followed by the transformation to perform.  Since the column name is included as the first element in the transformations list, all subsequent references to the column name should use an underscore _ instead of the actual column name.  

 

 

Table.TransformColumns(Source,{{"Hiring Effective Date", each Date.AddDays(_,1), type date}})

 

 

BEFORE (my date column is named Date)

jennratten_0-1630113755184.png

 

AFTER

jennratten_1-1630113781820.png

 

If this post helps to answer your questions, please consider marking it as a solution so others can find it more quickly when faced with a similar challenge.

Proud to be a Microsoft Fabric Super User

thanks a million. I was trying to apply this transformation on 3 columns of a table, and couldn't get it right, as I was again passing the column reference instead of the underscore. 

 

mahoneypat
Microsoft Employee
Microsoft Employee

Please try this instead

 

= Table.TransformColumns(#"Changed Type",{{"Hiring Effective Date", each Date.AddDays([Hiring Effective Date],1), type date}})

 

Pat





Did I answer your question? Mark my post as a solution! Kudos are also appreciated!

To learn more about Power BI, follow me on Twitter or subscribe on YouTube.


@mahoneypa HoosierBI on YouTube


Anonymous
Not applicable

I'm afraid it got me an error now:

Magdoulin_0-1630105191462.png

Helpful resources

Announcements
July 2025 community update carousel

Fabric Community Update - July 2025

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

July PBI25 Carousel

Power BI Monthly Update - July 2025

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

Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

Top Solution Authors
Top Kudoed Authors