cancel
Showing results for 
Search instead for 
Did you mean: 

Fabric is Generally Available. Browse Fabric Presentations. Work towards your Fabric certification with the Cloud Skills Challenge.

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
PBI November 2023 Update Carousel

Power BI Monthly Update - November 2023

Check out the November 2023 Power BI update to learn about new features.

Community News

Fabric Community News unified experience

Read the latest Fabric Community announcements, including updates on Power BI, Synapse, Data Factory and Data Activator.

Power BI Fabric Summit Carousel

The largest Power BI and Fabric virtual conference

130+ sessions, 130+ speakers, Product managers, MVPs, and experts. All about Power BI and Fabric. Attend online or watch the recordings.

Top Solution Authors