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

Conditional Column

I am working with a Conditional  Column and I want to make the Date Current Date +28 Days instead of hard coded below

 

= Table.AddColumn(#"Filtered Rows", "Custom Order Finish Date", each if [Ordfinish] >= #date(2022, 7, 28) then "TBD" else [Ordfinish])

1 ACCEPTED SOLUTION
Vijay_A_Verma
Super User
Super User

Replace #date(2022, 7, 28) with

Date.AddDays(Date.From(DateTime.FixedLocalNow()),28)

View solution in original post

4 REPLIES 4
HotChilli
Super User
Super User

DateTime.LocalNow()

and

 

Date.AddDays()

are the 2 functions you need

otravers
Super User
Super User

Add 28 days to:

 

Date.From(DateTime.LocalNow())

 

- https://docs.microsoft.com/en-us/powerquery-m/date-adddays

https://docs.microsoft.com/en-us/powerquery-m/datetime-localnow 

------------------------------------------------
1. How to get your question answered quickly - good questions get good answers!
2. Learning how to fish > being spoon-fed without active thinking.
3. Please accept as a solution posts that resolve your questions.
------------------------------------------------
More tips and guidance in my Power BI architecture and development blog
Vijay_A_Verma
Super User
Super User

Replace #date(2022, 7, 28) with

Date.AddDays(Date.From(DateTime.FixedLocalNow()),28)

Thanks this worked

 

Helpful resources

Announcements
August 2022 update 768x460.jpg

Check it Out!

Click here to learn more about the August 2022 updates!

August 1 episode 9_no_dates 768x460.jpg

The Power BI Community Show

Watch the playback when Priya Sathy and Charles Webb discuss Datamarts! Kelly also shares Power BI Community updates.

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.

Top Solution Authors