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

Get certified in Microsoft Fabric—for free! For a limited time, get a free DP-600 exam voucher to use by the end of 2024. Register now

Reply
Anonymous
Not applicable

Adding DateTime.Local() as an imported datetime column

Hello,

 

I am trying to add an imported date column during the Power Query step of my dataflow. I have an inserted timestamp for the source, however that timestamp can change. I am trying to utilize the incremental refresh capabilities of Dataflows and advice from Microsoft is that if one wants to use the (Detect Max Data Changes) option, I would need a DateTime column that would not change.

 

This led to me trying to create the DateTime column in Power Query. I cannot use DAX since DAX is not allowed at this step of the Dataflow process.

I tried adding a custom column (seen below) but am getting this error: 

Table.AddColumn(#"Removed columns", "Custom", DateTime.LocalNow())
We cannot convert the value #datetime(2020, 2, 27, 11, 39, 28.9966141) to type Function.

Any help on this would be greatly appreciated.

Thank you!
1 ACCEPTED SOLUTION
HotChilli
Super User
Super User

It's close.  It needs an "each" before DateTime.LocalNow

 

Did you type this in the advanced editor? If you use the 'Add Column' in the interface, it adds it for you

View solution in original post

2 REPLIES 2
HotChilli
Super User
Super User

It's close.  It needs an "each" before DateTime.LocalNow

 

Did you type this in the advanced editor? If you use the 'Add Column' in the interface, it adds it for you

Anonymous
Not applicable

Thank you @HotChilli it worked.

To your later question, yes I started with adding a conditional column then edited it in the advanced editor. I was unable to find the add new column in the interface. could you point me to where it is?



Helpful resources

Announcements
November Carousel

Fabric Community Update - November 2024

Find out what's new and trending in the Fabric Community.

Live Sessions with Fabric DB

Be one of the first to start using Fabric Databases

Starting December 3, join live sessions with database experts and the Fabric product team to learn just how easy it is to get started.

Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Early Bird pricing ends December 9th.

Nov PBI Update Carousel

Power BI Monthly Update - November 2024

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