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

Don't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.

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
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

Jan25PBI_Carousel

Power BI Monthly Update - January 2025

Check out the January 2025 Power BI update to learn about new features in Reporting, Modeling, and Data Connectivity.

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.