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
kman42
Helper III
Helper III

Power Query: replace value less than

I need to replace the value of a column if the original value is less than a certain date. I have it working with a discreet date, but how do I modify the following to make it work for any date less than 1970-01-01?

 

#"Replaced Value" = Table.ReplaceValue(#"Expanded project","1962-01-01",null,Replacer.ReplaceValue,{"award_notice_date"}),

 

Thanks!

2 ACCEPTED SOLUTIONS
alena2k
Resolver IV
Resolver IV

I would add conditional column:
= Table.AddColumn(#"Expanded project", "Replaced Award Date", each if [award_notice_date] < #date(1970, 1, 1) then null else [award_notice_date])

View solution in original post

v-xuding-msft
Community Support
Community Support

Hi @kman42 ,

 

Have you resolved the problem? If not, please try like this:

= Table.ReplaceValue(#"Expanded project",#date(1962, 1, 1),null,Replacer.ReplaceValue,{"Date"})

3.PNG

 

Best Regards,
Xue Ding
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

2 REPLIES 2
v-xuding-msft
Community Support
Community Support

Hi @kman42 ,

 

Have you resolved the problem? If not, please try like this:

= Table.ReplaceValue(#"Expanded project",#date(1962, 1, 1),null,Replacer.ReplaceValue,{"Date"})

3.PNG

 

Best Regards,
Xue Ding
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
alena2k
Resolver IV
Resolver IV

I would add conditional column:
= Table.AddColumn(#"Expanded project", "Replaced Award Date", each if [award_notice_date] < #date(1970, 1, 1) then null else [award_notice_date])

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