cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
TrevorBoat
Helper I
Helper I

Can I replace a date in a column in Power Query - Last day of Month plus 1

Hi,

 

Can I replace a date in a column in Power Query - Last day of Month plus 1or the first day of the next month?

 

I tried to do this with replace values:

 

= Table.ReplaceValue(#"Removed Columns",#date(Date.EndOfMonth),Date.EndOfMonth +1,Replacer.ReplaceValue,{"_date"})

 

Thanks!

1 ACCEPTED SOLUTION
TheoC
Super User
Super User

Hi @TrevorBoat 

 

In Power Query, go to Add Column tab, then click on Custom Column.  Add the below formula:

 

= Date.AddDays ( Date.EndOfMonth ( [Date Column] ) , 1 )

 

The output will be the Green column.  Make sure that you change the new custom column (i.e. in my example "End of Month + 1") to Date type.

 

TheoC_0-1652397870977.png

Hope this helps!

 

Theo 🙂

 

 

If I have posted a response that resolves your question, please accept it as a solution to formally close the post.

Also, if you are as passionate about Power BI, DAX and data as I am, please feel free to reach out if you have any questions, queries, or if you simply want to connect and talk to another data geek!

Want to connect?www.linkedin.com/in/theoconias

View solution in original post

1 REPLY 1
TheoC
Super User
Super User

Hi @TrevorBoat 

 

In Power Query, go to Add Column tab, then click on Custom Column.  Add the below formula:

 

= Date.AddDays ( Date.EndOfMonth ( [Date Column] ) , 1 )

 

The output will be the Green column.  Make sure that you change the new custom column (i.e. in my example "End of Month + 1") to Date type.

 

TheoC_0-1652397870977.png

Hope this helps!

 

Theo 🙂

 

 

If I have posted a response that resolves your question, please accept it as a solution to formally close the post.

Also, if you are as passionate about Power BI, DAX and data as I am, please feel free to reach out if you have any questions, queries, or if you simply want to connect and talk to another data geek!

Want to connect?www.linkedin.com/in/theoconias

Helpful resources

Announcements
Power Platform Conf 2022 768x460.jpg

Join us for Microsoft Power Platform Conference

The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.

Power BI Dev Camp Session 23 768x460.jpg

Check it Out!

Mark your calendars and join us on Thursday, June 30 at 11a PDT for a great session with Ted Pattison!

Top Solution Authors
Top Kudoed Authors