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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It 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
RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.

MayPowerBICarousel

Power BI Monthly Update - May 2024

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

LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.

Top Solution Authors
Top Kudoed Authors