I know this should be easy but ……… I have a date column that should be filled in and is empty and the query returns null. I’d like to use the replace null function in the query editor to replace the nulls with random dates between today and some future date. When I try adding the power query formula I get an error message asking me to enter a specific date.
—————————— Allan Blain Project Manager Portland OR 2052135310 ——————————
Del Swingle
Member
September 15, 2018 at 4:22 PM
Allan, As a suggestion, you could create a new custom column that looks at the original Date column and use an if statement similar to the following:
Ā if [Date]=null then Number.RandomBetween(Number.From(DateTime.LocalNow()),Number.From(Date.AddDays(DateTime.LocalNow(),365))) elseĀ [Date]
This will look for any nulls in you Date column and generates random date between today and 1 year from now and copy any values not null. This will return a date serial number so you’ll need to convert this new column to type date.
Hopefully this helps,
—————————— Del Swingle WA —————————— ——————————————-
Please note:
This action will also remove this member from your connections and send a report to the site admin.
Please allow a few minutes for this process to complete.
Report
You have already reported this .
Welcome to our new site!
Here you will find a wealth of information created for peopleĀ that are on a mission to redefine business models with cloud techinologies, AI, automation, low code / no code applications, data, security & more to compete in the Acceleration Economy!