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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
Anonymous
Not applicable

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
Community Champion
Community Champion

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.
------------------------------------------------
BI Blog: Datamarts | RLS/OLS | Dev Tools | Languages | Aggregations | XMLA/APIs | Field Parameters | Custom Visuals
Vijay_A_Verma
Super User
Super User

Replace #date(2022, 7, 28) with

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

Anonymous
Not applicable

Thanks this worked

 

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

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

April Fabric Community Update

Fabric Community Update - April 2024

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

Top Solution Authors
Top Kudoed Authors