Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!
Hi,
I currently have a column 'Done' where Rows contain either a date, or are blank. I'm creating a new custom column that turns these dates into 'week commencing' dates. my query so far is;
#"Inserted Start of Week" = Table.AddColumn(#"Filtered Rows", "Start of Week", each Date.StartOfWeek(DateTime.From([Done])), type datetime)
in
#"Inserted Start of Week"
This works for those rows with dates, but throws errors where the row is blank. My thought was to include an 'otherwise null' expression, but whatever I try results in either a 'token literal expected' or 'token comma expected' syntax error.
Can anyone help?
Solved! Go to Solution.
Hi @ChrisBroome
Try this
= Table.AddColumn(#"Filtered Rows", "Start of Week", each try Date.StartOfWeek(DateTime.From([Done])) otherwise null)
Phil
If I answered your question please mark my post as the solution.
If my answer helped solve your problem, give it a kudos by clicking on the Thumbs Up.
Proud to be a Super User!
Hi @ChrisBroome
Try this
= Table.AddColumn(#"Filtered Rows", "Start of Week", each try Date.StartOfWeek(DateTime.From([Done])) otherwise null)
Phil
If I answered your question please mark my post as the solution.
If my answer helped solve your problem, give it a kudos by clicking on the Thumbs Up.
Proud to be a Super User!